I recently installed MySQL 5.7.12 with the command before installing MySQL 5.7.11
Bin/mysqld--initialize--user=mysql
Can be very well initialized, but used in 5.7.12 Version actually error
[Email protected] mysql-5.7.12]# bin/mysqld--initialize--user=mysql
2016-04-28t09:50:25.142068z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-28t09:50:25.142323z 0 [ERROR] Can ' t find error-message file '/usr/local/mysql/share/errmsg.sys '. Check error-message file location and ' lc-messages-dir ' configuration directive.
2016-04-28t09:50:25.144865z 0 [ERROR]--initialize specified but the data directory have files in it. Aborting.
2016-04-28t09:50:25.144934z 0 [ERROR] aborting
Later found that CentOS comes with/etc/my.cnf and/etc/mysql did not delete, and then delete the two files after the use of this command
Still error
Mysqld:can ' t create directory '/usr/local/mysql/data/' (Errcode:2-No such file or directory)
2016-04-28t09:53:24.465575z 0 [ERROR] Can ' t find error-message file '/usr/local/mysql/share/errmsg.sys '. Check error-message file location and ' lc-messages-dir ' configuration directive.
2016-04-28t09:53:24.467928z 0 [ERROR] aborting
Later on the Internet to find the use of the MYSQLD command to initialize
You should create the data file under the MySQL Wish folder, but remember that the data file is automatically generated in version 5.7.11
mkdir data
Then execute the following sentence
Bin/mysqld--user=mysql--basedir=/usr/local/mysql-5.7.12--datadir=/usr/local/mysql-5.7.12/data/--initialize
2016-04-28t10:01:07.730549z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-28t10:01:08.194212z 0 [Warning] innodb:new log files created, lsn=45790
2016-04-28t10:01:08.725913z 0 [Warning] innodb:creating FOREIGN KEY constraint system tables.
2016-04-28t10:01:08.810579z 0 [Warning] No existing UUID have been found, so we assume that's the first time that thi s server has been started. Generating a new uuid:213135a4-0d28-11e6-b869-000c299613e3.
2016-04-28t10:01:08.816207z 0 [Warning] Gtid table is not a ready-to-be used. Table ' mysql.gtid_executed ' cannot be opened.
2016-04-28t10:01:08.819712z 1 [Note] A temporary password is generated for [email protected]:%?KTFF<E8XXL
That's a success. Give the initial password, then copy the support-files/my-default.cnf to/etc/, and configure
You can do it!
MySQL 5.7.12----bin/mysqld--initialize--user=mysql error