Regarding the installation of MySQL, the solution reported [Windows cannot start MySQL service (located on the local computer) error 2 The system cannot find the specified file]

After the MySQL downloaded from the official website is installed, after downloading the MySQL service through the command [mysqld -install], run the command [net start mysql] to fail to start MySQL and report [Windows cannot start the MySQL service (located on the local computer) error 2 The system cannot be found To the specified file], the error is probably as shown in the figure below.
Insert picture description here
As the system prompts, the system cannot find the specified file. You can first use the command [mysqld -install] to view the mysqld installation path in DOS opened as an administrator. The content is roughly as follows.

C:\windows\system32>mysqld -install
The service already exists!
The current server installed: "C:\Program Files\MySQL\MySQL Server 8.0\mysqld" MySQL

After entering the directory [C:\Program Files\MySQL\MySQL Server 8.0], the mysqld executable file was not found, as shown in the figure below.
Insert picture description here
Open the directory [bin] in the figure above, you can find the executable file mysqld is in this directory, so you need to modify the search path.
Insert picture description here
Search for Registry Editor in the search bar in the image above. Find the Image
Path according to the path [\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL] and modify the path, as shown in the figure below.
Insert picture description here
After the modification, you can successfully use the command [net start mysql] to start the MySQL database.

Guess you like

Origin blog.csdn.net/ISs_Cream/article/details/110406889