could not start the service MySQL.error 0

mahesh picture mahesh · Nov 9, 2010 · Viewed 16.8k times · Source

I am getting the following error when I try to configure MySQL instance, could any one help out to resolve this error.

I am using Windows XP SP2.

Answer

ajreal picture ajreal · Nov 14, 2010

If you reinstall or upgrade MySQL without first stopping and removing the existing MySQL service and install MySQL using the MySQL Configuration Wizard, you may see this error: Error: Cannot create Windows service for MySql. Error: 0

This occurs when the Configuration Wizard tries to install the service and finds an existing service with the same name.

One solution to this problem is to choose a service name other than mysql when using the configuration wizard. This enables the new service to be installed correctly, but leaves the outdated service in place. Although this is harmless, it is best to remove old services that are no longer in use.

To permanently remove the old mysql service, execute the following command as a user with administrative privileges, on the command-line:

shell> sc delete mysql [SC] DeleteService SUCCESS

If the sc utility is not available for your version of Windows, download the delsrv utility from http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/delsrv-o.asp and use the delsrv mysql syntax.

-- http://dev.mysql.com/doc/refman/5.0/en/windows-troubleshooting.html