MySQL startup service prompts that the system cannot find the specified file

Mysql start service:

C:\Windows\system32>net start mysql
system error 2 occurred.

The system can not find the file specified.

Why is this error still reported? Isn't it because of the configuration? Yes, it is not due to the above configuration, but there is nothing wrong with the above configuration after adding. What's the reason?

Here is the most important point. When installing the mysql service, you must switch to the bin directory of the mysql installation directory, regardless of whether you configure the environment variable or not, otherwise the above error will be reported after the installation is started.

After switching to the bin directory, delete the previously installed mysql service (deleting the service does not have to go to the bin directory), then reinstall the mysql service in the bin directory, and then start:


C:\Windows\system32>cd ../..

C:\>cd Program Files\MySQL\MySQL Server 5.6\bin

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqld --remove
Service successfully removed.

C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqld --install
Service successfully installed.

C:\Program Files\MySQL\MySQL Server 5.6\bin>net start mysql
MySQL service is starting.
MySQL service has been started successfully.

Guess you like

Origin blog.csdn.net/suifeng629/article/details/107097571