Problem Description:
5.7 from the Internet under the MySQL, in the bin directory to execute start mysqld, a pop-up cmd window flash is gone, also can not see what is the error. MYSQLD--install installed the service, also can not start.
Processing steps:
1, open the Event Viewer to check the error information
2, online search, said that if it is Linux needs to perform mysql_install_db, if it is windows need to copy user.frm user. MyD and User.myi
3, however, Http://serverfault.com/questions/291126/mysql-fatal-error-cant-open-and-lock-privilege-tables-table-mysql-host-doe
There's a suggestion to use mysqld--initialize.
Execute the following, the error:
C:\Program files\mysql\mysql Server 5.7\bin>mysqld--initialize
2016-12-20t04:33:22.298853z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
Deprecated. Use--explicit_defaults_for_timestamp server Option (
Umentation for more details).
2016-12-20t04:33:22.298853z 0 [Warning] ' no_zero_date ', ' no_zero_in_date ' and ' E
Rror_for_division_by_zero ' SQL modes should is used with strict mode. They would
be merged with strict mode in a future release.
2016-12-20t04:33:22.298853z 0 [Warning] ' no_auto_create_user ' SQL mode is not s
Gtl
2016-12-20t04:33:22.303853z 0 [ERROR]--initialize specified but the data direct
Ory has files in it. Aborting.
2016-12-20t04:33:22.304853z 0 [ERROR] aborting
4, because all is the test data, I directly DataDir (mine is D:\MysqlData) folder to delete. Perform mysqld--initialize again
C:\Program files\mysql\mysql Server 5.7\bin>mysqld--initialize
5, start the service (if there is no installation services, you need to perform mysqld--install)
C:\Program files\mysql\mysql Server 5.7\bin>net start MySQL
The MySQL service is starting.
The MySQL service has started successfully.
This method is better than copying user. File is simple, but you need to clear all the data to fit your test environment.