Solve the Problem of cocould not start the service MySQL error: 0 when installing and reinstalling mysql, mysqlcocould
Cocould not start the service mysql error: 0
Cause:When you uninstall mysql, the related files and services are not completely deleted and need to be cleared manually.
The service cannot be started when the last execute step is installed.Solution:
First, stop the MySQL service in the management tools> Service (some services are not successfully installed, but stopped), win + R-> cmd, open the Command Prompt window, enter the command SC delete mysql (view the service, there is no mysql in the service), delete the stopped service, uninstall MySQL, and select remove. Finally, delete the MySQL installation directory and the database directory.
Enter regedit at the command prompt to open the registry.
In the Registry
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL
Delete the key mysql values (mysql and mysqladmin) in the relevant directory
MySQL related items in the registry may not be completely deleted. ctrl + F is used to search for mysql, F3 is used to find all related items of the MySQL software.
Note:(An error occurred while deleting the item ):
Unable to delete LEGACY_MYSQL51 (username set during database creation): An error occurred while deleting the item.
Solution:Right-click the registry entry to add all the permissions for administrators, and then open 360 security guard or Kingsoft guard to clear the registry!
Then, delete the MYSQL Data Table directory (C:/Documents and Settings/All Users/Application Data/MySQL Server 5.1/Data/) (Application Data is hidden, set it to display in view
Generally, Windows 7 uses the C: \ ProgramData \ MySQL directory. Note that the ProgramData folder is hidden by default ),
Finally, restart the computer, reinstall mysql, run the wizard Server Instance Configuration wizard, and perform relevant settings.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.