MySQL cannot be started in Windows, and WindowsMySQL cannot be started.
Problem description:From MySQL 5.7 on the internet, execute start mysqld in the bin directory. the pop-up cmd window will disappear, and you cannot see what the error is. Mysqld -- install has installed the service and cannot be started.Procedure:1. Open the Event Viewer to check the error message. 2. Check the error message online. It indicates that mysql_install_db needs to be executed for linux and user needs to be copied for Windows. frm user. MYD and user. MYI3, however, http://serverfault.com/questions/291126/mysql-fatal-error-cant-open-and-lock-privilege-tables-table-mysql-host-doe is recommended heremysqld --initialize
Run the following error: C: \ Program Files \ MySQL Server 5.7 \ bin> mysqld -- initialize2016-12-20T04: 33: 22.298853Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. please use -- explicit_defaults_for_timestamp server option (see documentation for more details ). 2016-12-20T04: 33: 22.298853Z 0 [Warning] 'No _ ZERO_DATE ', 'no _ ZERO_IN_DATE' and 'error _ FOR_DIVISION_BY_ZERO 'SQL modes shocould be used with stri Ct mode. they willbe merged with strict mode in a future release.2016-12-20T04: 33: 22.298853Z 0 [Warning] 'No _ AUTO_CREATE_USER 'SQL mode was not set.2016-12-20T04: 33: 22.303853Z 0 [ERROR] -- initialize specified but the data directory has files in it. aborting.2016-12-20T04: 33: 22.304853Z 0 [ERROR] Aborting 4. Because all the test data is used, I directly Delete the datadir (my D: \ MysqlData) folder. Execute againmysqld --initialize
C: \ Program Files \ MySQL Server 5.7 \ bin> mysqld -- initialize 5. Start the Service (if the service is not installed, run mysqld -- install first) C: \ Program Files \ MySQL Server 5.7 \ bin> net start mysqlMySQL service is being started. the MySQL service has been started successfully. This method is easier than copying a user. file. However, you need to clear all the data, which is suitable for use in your own testing environment.