Mysql 5.7 installation of MySQL service cannot be started, but the service does not report any error, mysql5.7

Source: Internet
Author: User

Mysql 5.7 installation of MySQL service cannot be started, but the service does not report any error, mysql5.7

There are two ways to install MySQL 5.7. One is to download the installer, click Install, and the other is to download the compressed package, decompress it directly, and configure it to run.

I personally prefer the compressed package format. Therefore, this article records the installation (configuration) of compressed packages)

Https://dev.mysql.com/downloads/mysql/

I downloaded the latest mysql-5.7.17-win32.zip

Pressurize to the mysql-5.7.17-win32 folder, the files and folders mentioned later use this as a more directory

Configure the bin directory to the end of the Environment Variable path.

My is; D: \ mysql-5.7.17-win32 \ bin

Copy the my-default.ini file and rename it my. ini

All files are commented out by default.

Directly Add the following parameters

[mysqld]port=3306basedir=D:\mysql-5.7.17-win32datadir=D:\mysql-5.7.17-win32\dataskip-grant-tables 

Change the red path to your own directory.

Skip-grant-tables is an important configuration item to skip logon verification.

You do not know which account to use to log on to mysql after installation. People who have used mysql before may know the root account, but cannot log on with root at this time.

Then open cmd

Run

Mysqld install MySQL -- defaults-file = "D: \ mysql-5.7.17-win32 \ my. ini" // Delete can be removed with mysqld, each time I modify my. ini needs to be re-installed

After success, you can start mysql

Run

Net start mysql // the command to close is net stop mysql

Report

The MySQL service cannot be started. The Service did not report any errors.

You need to execute

mysqld --initialize-insecure

This command will create a data folder under the mysql root directory

Then execute

net start mysql

This is the success.

Run

Mysql-u root-p press ENTER

Enter the password. Press enter.

Successfully logged on to mysql

Then

Use mysql // enter the mysql database

Set root Password

update user set authentication_string = password('root'), password_expired = 'N', password_last_changed = now() where user = 'root';

Note that authentication_string 5.7 is a password before

To connect to a remote client, run

Grant all on *.* to 'root'@'%' identified by 'root' with grant option;

In this way, you can connect to the mysql instance remotely. Otherwise, you can only connect to the mysql instance locally.

The above is a small Editor to introduce to you that mysql 5.7 installation of MySQL service cannot be started, but the service does not report any errors, I hope to help you, if you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.