Home  >  Article  >  Database  >  What should I do if net start mysql cannot start MySQL?

What should I do if net start mysql cannot start MySQL?

醉折花枝作酒筹
醉折花枝作酒筹forward
2021-06-02 09:18:283989browse

This article will introduce to you how to solve the problem of "net start mysql" failing to start MySQL. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

What should I do if net start mysql cannot start MySQL?

Today is the first time to learn MySQL. During the process of installing and starting MySQL, I discovered two small problems that are easily overlooked. One is the MySQL operation permission issue, and the other is the MySQL service name issue, which is hereby recorded.

Problem description: Entering "net start mysql" in the command prompt window cannot start MySQL.

The system is Windows8.1, and the MySQL software is mysql-installer-community-5.7.12.0.

1.MySQL startup permission problem

(1) During the installation of MySQL, the following page will appear:

In In the Root Account Password area of ​​this page, the password we set is Root Password, which is the password corresponding to the administrator's identity. We usually click Next directly after setting the password without clicking "Add User" in the lower area to set up a normal user. This will cause us to easily forget that we should use administrator rights to start MySQL when starting MySQL.

(2) MySQL started without administrator rights

The following is the situation when I started MySQL for the first time:

Operation: Win R, enter cmd, Start the command prompt window and enter "net start mysql".

Result: System error 5 occurred. access denied.

What should I do if net start mysql cannot start MySQL?

(3) MySQL started with administrator privileges

To address this problem, I used a command prompt window with administrator privileges.

Operation: WIN

Result: The MySQL service has been started successfully.

What should I do if net start mysql cannot start MySQL?

#So, the solution to this problem is to use Command Prompt (Admin).

2. MySQL service name problem

What should I do if net start mysql cannot start MySQL?(1) During the installation of MySQL, the page shown below will appear:

Note: During the installation process , the name in the red selection box defaults to MySQL57 (corresponding to version 5.7), and I changed it to "MySQL" at this time. The crux of the second problem lies in this name.

The meaning of the name of the red box in the above picture is to name the MySQL program in the Windows system service window. In other words, the name here is the same as the name of the service window. If we do not change "MySQL57" to "MySQL", then when starting the MySQL program in the command prompt window, we should enter "net start mysql57" instead of "net start mysql".

(2) Windows system service window

The Windows system service window was mentioned above. Let’s talk about this window. What should I do if net start mysql cannot start MySQL?

Win R starts the running window, enter services.msc, and press Enter, as shown in the following figure:

The service window is as follows, where the red selection box is each The service name of the program.

What should I do if net start mysql cannot start MySQL?Because I have changed "MySQL57" to "MySQL" during the installation process, the name of my MySQL program in the service list is as shown below.

What should I do if net start mysql cannot start MySQL?In this way, when I start MySQL using the prompt window, I can use "net start mysql" instead of entering "net start mysql57".

3. Summary

Use administrator rights to start MySQL when starting up. When installing MySQL, name the service name directly as "MySQL".

Related recommendations: "mysql tutorial"

The above is the detailed content of What should I do if net start mysql cannot start MySQL?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete