MySQL installation: “could not start the service mysql”

could not start the service mysql.mysqlerror2

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.

PROBLEM:

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.

SOLUTION:

  • 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.

    MySQL registry

    MySQL key in regedit (click to enlarge)

  • 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

Advertisements

37 Comments

  1. keywords: mysql vista start service cannot be started vista 64 error mysql5 vista installation configuration wizard error
    —————————
    Hallelujah! Great stuff. I’ve been on this for hours now. I installed it and needed to uninstall. I did so, and guess what, it wouldn’t work. I thought it was Vista 64 bit f***ng with my head. Tried everything included, uninstalling IIS, disabling user accounts (UAC), taking off firewalls. Was sure I wasn’t doing anything different than the first time I installed it.

    The configuration wizard does not start the service. Cancel, and go to start / stop / restart the MySQL service manually. Restart the config wizard if you want to complete your security settings step.

  2. Good God You have saved my day!

    I couldn’t figure this out for the life of me, searching the internets up and down without any complete answers until I saw your solution to this. I am tempted to distribute it further with little tweaks for those still on a windows xp system. Thanks again for saving my day!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s