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

MySQL Error 0

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

Delete MySQL Service via Command Prompt

Step 6)Uninstall MySQL Server 5.X via the control panel.

Step 7)Open the C:\ directory.
Open the C:\ Directory

Step 8) 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.)
Show Hidden Files

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

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

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:

About the Author:

Joseph is the lead developer of Vert Studios, a web design company located in Tyler, Tx. Follow him on Twitter! @Joe_Query.

  1. Ann

    Great!!!!!!!!!!!!!Thanks a lot !The first site that i found useful information!!!!!!!!!!!!!!!many thanks!!!!!!!!!!!!

  2. Aleksander

    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

  3. Ogiba

    thank you..!!!!! this worked!

  4. It’s work!!

    thanks dude.

    Regard from Indonesia :)

  5. Evarist

    It work for me too.

    Thanks dude.

    Regards from Tanzania(Africa)

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

    • Mahwish

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

  7. Ernest

    Works for me. Thanks for your help.

  8. Nico

    Thank you really much!

  9. Jean-Luc

    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

  10. chuka

    how can i join this group, you guys are the best.

  11. Tenon

    wonderful, it works pretty well for me . Thanks

  12. Josh

    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?:[

  13. Toyu

    Thanks. It works for my Windows 7 64-bit as well.

  14. Danilo

    Thanks, its working perfectly

  15. shiva

    thanks dude it worked for me…….

  16. charmi

    Thanks it worked for me.

  17. Danny

    Excellent!

    It was the hidden ‘Program Data’ folder that was causing MySQL to not start for me.

    Many many thanks.

  18. ozhnzg

    i’ve been searching for almost two hours but nothing was so useful like this. thanks for this support.

  19. Luj

    I tried it. completely uninstalled it but could not re-install it. Problem persist!

  20. jansdft

    Thanks…
    Its working fine

  21. Aps

    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

  22. Well done. I can confirm that this fix also works for MySQL installation snafus on Windows 7 64-bit. Thanks for posting!

  23. Hijat

    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!

  24. hawk

    I love you so much, my good sir.

  25. Vikram

    Thanks a lot!!! Program Data was the culprit…good catch!!

  26. ylnsagar

    thank you joseph, it worked.

  27. Ramkumar

    thank you joseph……

  28. Saisrinivas

    hey dude,,
    a very thanks , its worked for me,,!!
    Always greatful to you ,

  29. working fine thanks a lot

  30. umakant rajpoot

    thanks a lot joseph to post this material
    really it helps to persons that are suffering from this problem

  31. Michael

    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.

  32. oneworld

    Excellent, it worked for me!

  33. Carlos

    Me funciono de maravilla!!!!

  34. Kea

    Thank you very very much.God bless you. I really needed to use Mysql.THank ;)

  35. Chetan Kumar

    Thanks a lot…finally i successfully installed.
    Very valuable information.

  36. Jose

    You are the man! Thanks a lot!.

  37. Mahmudul

    Thanks for the information. It works for me…Good Post

  38. Mahwish

    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…

  39. tariq

    Thanks!!
    i will not cry this time….
    sob…sob…

Add to the conversation: