Bug #72678 InnoDB Memcached Plugin Configuration - test database
Submitted: 19 May 2014 11:02 Modified: 9 Jun 2014 13:20
Reporter: Dimitar Nikov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Memcached Severity:S4 (Feature request)
Version:5.6.17, 5.6.19 OS:Linux
Assigned to: CPU Architecture:Any
Tags: InnoDB Memcached Plugin Configuration

[19 May 2014 11:02] Dimitar Nikov
Description:
I have a problem when trying to execute configuration script for InnoDB Memcached Plugin. I already executed mysql_secure_installation script which removes database named `test` (in my case I chose to remove test database and access to it). But such database is used in configuration script for InnoDB Memcached Plugin, according to http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-installing.html. 

How to repeat:
Just run the InnoDB Memcached Plugin configuration script. By default is placed under MYSQL_HOME/share/innodb_memcached_config.sql . If you're already executed mysql_secure_installation and chose to remove test database - then script execution will fail.

Suggested fix:
Remove hard-coded database name or use 'CREATE DATABASE IF NOT EXISTS' statement.
Here is a simple patch:

--- /usr/share/mysql/innodb_memcached_config.sql        2014-03-14 21:07:29.000000000 +0200
+++ /usr/share/mysql/innodb_memcached_config.sql-new    2014-05-19 13:54:40.489897534 +0300
@@ -83,7 +83,9 @@
 INSERT INTO config_options VALUES("separator", "|");
 INSERT INTO config_options VALUES("table_map_delimiter", ".");

-USE test
+CREATE DATABASE IF NOT EXISTS test;
+
+USE test;

 -- ------------------------------------------------------------------------
 -- Key (c1) must be VARCHAR or CHAR type, memcached supports key up to 255
[19 May 2014 11:04] Dimitar Nikov
InnoDB Memcached config simple patch

Attachment: innodb_memcached_config.sql.diff (text/x-patch), 535 bytes.

[22 May 2014 11:28] MySQL Verification Team
Hello Dimiter,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[22 May 2014 11:30] MySQL Verification Team
// 5.6.19

- Install MySQL from binary tarball
- Secure the installation
- Setting Up Required Tables as per http://dev.mysql.com/doc/refman/5.6/en/innodb-memcached-installing.html

mysql-advanced-5.6.19]# bin/mysql -u root -p < share/innodb_memcached_config.sql
Enter password:
ERROR 1049 (42000) at line 86: Unknown database 'test'
[9 Jun 2014 13:20] Daniel Price
Fixed as of the upcoming 5.7.5 release, and here's the changelog entry:

 The "innodb_memcached_config.sql" configuration script would fail after
running the "mysql_secure_installation" script, which removes the MySQL
"test" database. The "innodb_memcached_config.sql" script now creates the
"test" database if it does not exist. 

Thank you for the bug report.