could not start the service mysql.
These six little words haunted me the last couple of hours, in an attempt to re-install MySQL Server 5.1. Despite endlessly googling them internets and browsing through the MySQL documentation, the solution was nowhere to be found.
Fortunately for you, I found the ultimate fix to this problem in 8 easy steps! Huzzah!
This fix is aimed at Windows Vista users, although it should be pretty much the same for XP/2000.
The error “could not start the service mysql” pops up the moment you try to re-install MySQL server. The reason why you’re getting this error is because there are still traces of the previous installation left on your computer, that are not removed during uninstall.
- STEP 1 – If you still have MySQL installed, go to the MySQL Server Instance Config Wizard and choose remove instance. After that, go to Programs and features in the control panel, and uninstall MySQL server.
- STEP 2 – Now find the MySQL directory in your installation directory (e.g. c:\program files) and delete it.
- STEP 3 – Bring up a command prompt (press windowskey + r and type cmd.exe (enter)) and insert the following command: “sc delete mysql” without the brackets. After executing it should say that the service has been removed from the system.
- STEP 4 – Press windowskey + r and enter “%appdata%” without the brackets. Now find the MySQL folder and delete it.
- STEP 5 – Press windowskey + r again, enter “%programdata% and delete the other MySQL folder.
- STEP 6 – Open regedit and go to HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services, here you’ll find a MySQL registry key (see screenshot), delete it. Do a search for all MySQL entries (press F3) and kill them.
- STEP 7 – Now for the last step, you should search your system for any leftover MySQL directories, or “my.ini” files, and delete them.
- STEP 8 – Now reinstall MySQL server, I recommend installing it in a different directory than the previous installation.
That’s it! Your new MySQL installation should be up and running now!
PS: Please leave a comment if these steps didn’t work for you.
PPS: Please leave a comment if these steps did work for you :D.
Last modified on August 10 2009