MySQL 5.7.12----bin/mysqld--initialize--user=mysql Error

Source: Internet
Author: User
Tags create directory deprecated uuid

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

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.