MySQL case: mysql5.6.14 configuration my.cnf Multiple instances, mysql_install_db initialization does not read MY.CNF configuration files
1.1.1. mysql5.6.14 multiple Instance my.cnf, initialization does not read MY.CNF configuration file
"Environment description"
In a/ETC/MY.CNF environment with multiple instance configurations, the MySQL error is initiated after the mysql_install_db is executed.
"Action Steps"
/ETC/MY.CNF configuration file:
[mysqld3307]
Innodb_data_file_path =ibdata1:1g:autoextend
Initialize database:
[Root@test home]# mysql_install_db--datadir=/home/mysql_3307--user=mysql--defaults-file=/etc/my.cnf
Installing MySQL system tables ... 2014-05-1311:07:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Use the--explicit_defaults_for_timestamp server option (documentationfor more details).
2014-05-13 11:07:33 8897 [note] Innodb:theinnodb memory heap is disabled
2014-05-13 11:07:33 8897 [note] innodb:mutexes and rw_locks use GCC atomic builtins
2014-05-13 11:07:33 8897 [note] innodb:compressed tables use zlib 1.2.3
2014-05-13 11:07:33 8897 [note] innodb:using Linux native AIO
2014-05-13 11:07:33 8897 [note] innodb:using CPU CRC32 Instructions
2014-05-13 11:07:34 8897 [note] innodb:initializing buffer pool, size = 128.0M
2014-05-13 11:07:34 8897 [note] innodb:completed initialization of buffer pool
2014-05-13 11:07:34 8897 [note] innodb:thefirst specified data file./ibdata1 did the new database to Exist:a
2014-05-13 11:07:34 8897 [note] innodb:setting file./ibdata1 size to MB
2014-05-13 11:07:34 8897 [note] Innodb:database physically writes the file full:wait ...
This column more highlights: http://www.bianceng.cn/database/MySQL/
2014-05-13 11:07:34 8897 [note] innodb:setting log file./ib_logfile101 size to MB
2014-05-13 11:07:34 8897 [note] innodb:setting log file./ib_logfile1 size to MB
2014-05-13 11:07:35 8897 [note] innodb:renaming log file./ib_logfile101 to./ib_logfile0
2014-05-13 11:07:35 8897 [Warning] innodb:new log files created, lsn=45781
2014-05-13 11:07:35 8897 [note] innodb:doublewrite buffer not found:creating new
2014-05-13 11:07:35 8897 [note] Innodb:doublewrite buffer created
When you start the MySQL instance, error.log the error:
2014-05-13 11:11:15 8989 [note] innodb:completed initialization of buffer pool
2014-05-13 11:11:15 8989 [ERROR] innodb:auto-extending data file./ibdata1 is to a differentsize 768 pages (rounded down To MB) than specified CNF file:initial65536 pages, max 0 (relevant if non-zero) pages!
2014-05-13 11:11:15 8989 [ERROR] innodb:could not open or create the system tablespace. If you are tried to add new datafiles to the system tablespace, and it failed he
Re, you are should now editinnodb_data_file_path in my.cnf back to what it is, and remove the new Ibdatafiles InnoDB In this failed attempt. InnoDB only wrote
Those files full of zeros, but did not yetuse them in any way. But be careful:do not remove old data files which containyour precious data!
2014-05-13 11:11:15 8989 [ERROR] Plugin ' InnoDB ' init function returned ERROR.
2014-05-13 11:11:15 8989 [ERROR] Plugin ' InnoDB ' registration as a STORAGE ENGINE.
2014-05-13 11:11:15 8989 [error]unknown/unsupported storage Engine:innodb
2014-05-13 11:11:15 8989 [ERROR] Aborting
2014-05-13 11:11:15 8989 [note] Binlog end
2014-05-13 11:11:15 8989 [note] shuttingdown plugin ' partition '
2014-05-13 11:11:15 8989 [note] shuttingdown plugin ' ARCHIVE '
Although a read/ETC/MY.CNF configuration file was specified when the mysql_install_db command was executed, the database was not actually read when it was initialized:
Output log when initialized:
2014-05-13 11:07:34 8897 [note] innodb:setting file./ibdata1 size to MB
To view the size of the/HOME/MYSQL_3307/IBDATA1:
[root@ test mysql_3307]# LS-LTRH |grep ibdata1
-RW-RW----1 mysql mysql 12M 11:07 ibdata1
You can find that the actual size of the Ibdata1 file created is also the default 12M of MySQL, not the 1G size configured in the configuration file, the error encountered when starting the instance, but also the ibdata1 file size does not match the configuration file.
"Cause of the error"
In the mysql5.6.14 version, when the mysql_install_db command reads the MY.CNF configuration file, it reads only the [mysqld] configuration module, which does not read the configured [MYSQLDNNN] in multiple instances, so in this case, Although MY.CNF is configured with a ibdata size of 1G, MySQL still uses the default 12M.
"Workaround"
Modify the MY.CNF, change [mysqldnnn] to [mysqld] in turn, and after the initialization, modify it back.
"Other possible causes."
There are errors due to insufficient datadir path space, but unless the ibdata in MY.CNF is very large, the general online situation will not happen.