This article will introduce to you the solution to the error when entering "net start mysql" in cmd. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
In the interface of DOS window, gitbush and some command line tools that can be used, when entering: net stop mysql, net start mysql, it always prompts: The service name is invalid .
The following prompt appears:
The reason is: because the net start service name is started, it is registered under win Serve. At this time, mysql is not registered in the service in the system. That is, there is no mysql service under the current path.
How to register MySQL into the win service? ! ! ! (Steps are as follows)
1. Go to bin
in the MySQL installation path. 2. Enter mysqld --install
# in the command line. ##Success: If Service successfully install appears, it means you have successfully installed it. Unsuccessful: If the above appears When writing text, you need to run the DOS window as an administrator, so that you can succeed 3. Execute net start mysql and the following will appear: Delete data file under mysql, re-execute mysqld --initialize to generate the data folder under the current path, and then execute net start mysql to start mysql Quickly open DOS as an administrator: Open the DOS command window as an administrator: Under bin in the current folder, hold down Shift and right-click the mouse to run the Dos window as an administrator. Related recommendations: "mysql tutorial"
The above is the detailed content of What should I do if I get an error when entering "net start mysql" in cmd?. For more information, please follow other related articles on the PHP Chinese website!