Windows Mysql 5.7 Failed to start solution _mysql

Source: Internet
Author: User

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.

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.