I get this error when trying to install MySQL: Error:0 cannot create Windows service for MySQL

The notorious “Error 0” with MySQL installations when using the MySQL “Server Instance Configuration Wizard” indicates that the MySQL Wizard was unable to install, start or configure the new server you are attempting to setup. We find “Error 0” commonly occurs when there is a previous installation of MySQL on a Windows machine, or even hidden file remnants of an earlier MySQL installation. It is easy to conclude that a previous installation of MySQL has been completely expunged from your system, but one has to maniacally hunt down and extirpate all old configuration and data files before the MySQL Server Instance Configuration Wizard will install a new MySQL database and start the Windows MySQL service. We recommend that you try the these steps if you see this error.

One user found that the following worked. We suggest trying this first.

  • 1. Cancel the configuration step. (If you haven’t already).
  • 2. Go back to the configuration wizard on the program list (newly installed.) Follow the “reconfigure” option.
  • 3. Uncheck the “modify security settings” box and reconfigure without changing the password. Make sure the password is blank.
  • 4. When you click “finish” on the final screen, the service fails to start. Click “cancel” and restart the configuration wizard. Reconfigure in the same way as before, but check the “modify” security settings” box and leave the “current password” field blank and fill in and confirm a new password. This time the service starts, security settings are applied, and MySQL works… hopefully.

In house, we found the following was successful.

  • 1. Cancel the configuration step. (If you haven’t already.)
  • 2. Start up the configuration wizard. Delete the previous instance. This will close the configuration wizard.
  • 3. Start up the configuration wizard again. Create a new instance. Usually this step will work and you are done.

For Windows XP,

  • 1. Run the MySQL Server Instance Configuration Wizard which is installed in the MySQL Program Files subdirectory. If the second Wizard window presents the option to “Remove Instance” choose that and then click NEXT and in the subsequent window click EXECUTE.
  • 2. Use Windows Explorer to navigate to the directory \Documents and Settings\All Users\Application Data. If you do not see the subdirectory \Application Data under All Users, while you are in the All Users directory go to the top menu, choose Tools/Folder Options/View, then click on the option “Show hidden files and folders”, then click OK. You should now see \Application Data in the All Users directory, click on it, see the directory MySQL and delete it.
  • 3. Now go to the \Program Files Directory, see the MySQL subdirectory and delete it.
  • 4. Some users have found that rebooting your machine at this point can make a difference between the next step failing or succeeding. So, let’s reboot Windows just in case …
  • 5. Now go back to the MySQL Server Instance Configuration Wizard and run it. The Wizard should now let you re-installl a new copy of MySQL. Be sure to pick the options for Specify as shown in the MySQL installation guide available on the Specify web server.

For Windows Vista, the process is very similar, delete the \Program Files\MySQL directory, and also unhide and delete the directory \ProgramData\MySQL.

If that does not work for any reason, here are various steps that can be taken:

  • 1. Confirm with Wndows XP’s “My Computer/Properties” that you have Windows Service Pack 3 installed.
  • 2. Specify 6 will only communicate with the MySQL database server if MySQL is configured to run on network port 3306.
  • 3. Remove MySQL via the Windows Control Panel, “add/remove programs” option.
  • 4. Use the Windows Control Panel, choose Administrative Tools, then Services, look for MySQL in the list. If it is there it will need to be stopped *and* deleted. If it is present, highlight it, then right mouse click on it and choose the ‘Properties” menu option. In the MySQL Properties window, click the “Stop” button and change the “Startup Type” to “Disabled”. This stops an existing MySQL service if it is running, and prevents it from automatically starting up. Now the service has to be removed from Windows using a text command window. Go to the Windows XP Start menu and choose “Run”. Type “cmd” in the run window, and click “OK”. The command window will pop open, in it type: sc delete MySQL. You should see either a SUCCESS message that the service was deleted, or a Service not found message, either is what you want. Exit the window.
  • 5. Confirm again that all of your MySQL data and configuration directories are deleted as described above.
  • 6. Then try reinstalling MySQL with the downloadable installation package from the MySQL web site.

If all of that fails, we commend you to your local systems administrator if you can grab one, and refer you to the MySQL help forums to help debug system and server issues: http://forums.mysql.com/read.php?11,19373,246717. If you’ve repeatedly failed to solve this MySQL problem, call or e-mail us, we will work with you to get it fixed.