MySQL Error 0 Cannot Create Windows Service
If you are visiting this page, most likely you have seen this on your screen after trying to reinstall MySQL 5.X

This is the MySQL Error 0, which usually follows a windows notification that mysqld.exe has stopped working. After reading many forum posts, it appears that there is no definite answer as to how to solve the problem. However, I finally came across a method that worked for me, and hopefully it will work for you. The OS in this scenario is Vista 32-bit.
The Problem
The problem is MySQL did not properly uninstall. Remnants of MySQL still exist on your computer, and the configuration wizard can not create a new MySQL service because of this. An indication of this is the fact that while you were trying to reinstall MySQL, you may have been prompted to enter your “old password.” A brand new configuration doesn’t ask for this.
The Solution
Step 1)If MySQL is still Installed, run the MySQL Server Instance Config Wizard. (Should be found in your start menu under MySQL)
Step 2)Select “Remove Instance”.

Step 3)Click Execute, and once complete, click finish.
Step 4)Open the Command Prompt
Step 5)Type in
sc delete mysql
into the command prompt. If it fails, that’s fine.

Step 6)Uninstall MySQL Server 5.X via the control panel.
Step 7)Open the C:\ directory.

Step
Make hidden folders visible. You can do this by pressing alt to bring up the menu, then go to Tools -> Folder Options. Click the View Tab, and look for “Hidden files and folders.” Then click “Show Hidden Files and Folders”. (If you need more guidance on making hidden files visible, you can visit the Microsoft tutorial.)

Step 9)In you C:\ drive, you will now see a folder named ProgramData that was not visible before. Open it.

Step 10)If you see the MySQL Folder, Delete it!

Step 11)Check the C:\Program Files directory. If you see a MySQL Folder, Delete it!
At this point, I was able to run the MSI Installer again and install MySQL normally.
Related Posts:


Great!!!!!!!!!!!!!Thanks a lot !The first site that i found useful information!!!!!!!!!!!!!!!many thanks!!!!!!!!!!!!
Great step by step explanation. Finally!! I already lost hope going through all the crap in google, until I found your solution. It works !!! Thank you, great job, you rock!!
A
Hey, A! Glad it helped.
thank you..!!!!! this worked!
It’s always nice to have things working again. Thanks for stopping by!
It’s work!!
thanks dude.
Regard from Indonesia
It work for me too.
Thanks dude.
Regards from Tanzania(Africa)
Hi Joseph,
Thanks for helping steps, but i have completed steps up to step 6. after that
i try to do for step7 but in my system there is no “Program Data” is not available in the C Drive.then i have deleted the mysql installed folder in the c driver also.Again i’m trying to start to install mysql 5.1 version still i’m facing the error like can’t start the service error : 0
could you please help me out that could be great help.
Thanks in advance,
Loka
You can show the program data via enabling the hidden files from folder options… you can install only..if files from regestry, program data is removed completely..
Works for me. Thanks for your help.
Thank you really much!
No problem!
Even if I’m using windows 7, u helped me a lot man, keep on posting useful information, really, was going through a lot with this, ur info helped resolved that error 0! thx again
how can i join this group, you guys are the best.
Thanks for the kind words! Just subscribe to our blog and share the article
wonderful, it works pretty well for me . Thanks
I don’t get it I installed good, but when i go to the wizard I only get standart and detailed configuration selections, there is no “remove instance” can anyone help?:[
Thanks. It works for my Windows 7 64-bit as well.
Thanks, its working perfectly
thanks dude it worked for me…….
Thanks it worked for me.
Excellent!
It was the hidden ‘Program Data’ folder that was causing MySQL to not start for me.
Many many thanks.
i’ve been searching for almost two hours but nothing was so useful like this. thanks for this support.
I tried it. completely uninstalled it but could not re-install it. Problem persist!
Thanks…
Its working fine
Hey, I was stuck with this problem and was unable to find any useful solution…thanks for ur help…my problem is resolved now and I have been able to install MySQL successfully!!
Thanks for sharing the useful info
Well done. I can confirm that this fix also works for MySQL installation snafus on Windows 7 64-bit. Thanks for posting!
Jo, man your article really helped me get the burden of frustrations off my heart and shoulders. Been wanting to get this thing straight for nearly 3 days, until i stumbled on your site!
Big Up man!
Regards from Tanzania!
I love you so much, my good sir.
Thanks a lot!!! Program Data was the culprit…good catch!!
thank you joseph, it worked.
thank you joseph……
hey dude,,
a very thanks , its worked for me,,!!
Always greatful to you ,
working fine thanks a lot
thanks a lot joseph to post this material
really it helps to persons that are suffering from this problem
Hi. I did most of the things as described in here but the problem still occurs. MySQL version 5.5 doesn’t have the Remove Instance option from Step 2, so I removed the service manually (deleted from the registry, and through sc delete mysql) then uninstalled the program, deleted MySQL files from ProgramData and Program Files. It isn’t the only problem with the installation, it stops at the second step throwing error that it can’t find my-template.cnf but it is resolved through copying my-template.ini from the MySQL folder to MySQL/bin folder. Then always occurs this Error 0.
Excellent, it worked for me!
Me funciono de maravilla!!!!
Thank you very very much.God bless you. I really needed to use Mysql.THank
Thanks a lot…finally i successfully installed.
Very valuable information.
You are the man! Thanks a lot!.
Thanks for the information. It works for me…Good Post
Thankssssssssssssssssssssssssssssssssssssssssssssssssssss a lot for your help… The Mantanence option was not visible in my configuration wizard… but i have removed the files from registery, from the program data…and at lastttt my SQL is installed successfulyy…
Thanks again…
Thanks!!
i will not cry this time….
sob…sob…