"MySQL case" mysql5.6.14 configuration my.cnf Multi-instance, mysql_install_db initialization does not read MY.CNF configuration file

Source: Internet
Author: User

1.1.1. mysql5.6.14 multiple Instance my.cnf, initialization does not read MY.CNF configuration file

"Environment description"

In a multi-instance configuration/ETC/MY.CNF environment, after executing mysql_install_db, start MySQL error.

"Action Steps"

/ETC/MY.CNF configuration file:

[mysqld3307]

Innodb_data_file_path =ibdata1:1g:autoextend

Initialize the database:

[Email protected] 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. --explicit_defaults_for_timestamp server Option (see 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 not exist:a new database to becreated!

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 ...

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 starting the MySQL instance, error.log 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 of a differentsize 768 pages (rounded D Own to MB) than specified in the. 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 tried to add new datafiles to the system tablespace, and it failed he

Re, you should now Editinnodb_data_file_path in my.cnf back to what's it was, and remove the new Ibdatafiles InnoDB created In this failed attempt. InnoDB only wrote

Those files full of zeros, but do not have yetuse them in any the. But is 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 failed.

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 '

While the mysql_install_db command was executed, the read/ETC/MY.CNF configuration file was specified, but the initialization of the database was not actually read when it was created:

Output log at initialization:

2014-05-13 11:07:34 8897 [Note] innodb:setting file./ibdata1 size to MB

To view the size of/home/mysql_3307/ibdata1:

[Email protected] Test mysql_3307]# LS-LTRH |grep ibdata1

-RW-RW----1 mysql mysql 12M 11:07 ibdata1

You can find that the actual created Ibdata1 file size is also the default MySQL 12M, not the configuration file configured in the 1G size, the instance encountered when launching an error, it is said that the Ibdata1 file size and the configuration file does not match.

"Cause of 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 [MYSQLDNNN] configured 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 is done, change it back.



"Other possible causes."

There are errors due to insufficient datadir path space on the Internet, but unless the ibdata configured in MY.CNF is very large, the general online situation will not occur.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.