Wednesday, March 25, 2009

The MySQL/Windows install Head Ache, now solved!!

I have recently had to install MySQL in a windows box (see the irony ! xD).. Everything seemed to install well except that when I ran the MySQL instance configuration wizard it was surprised it couldn't create the service and said: Cannot create Windows service MySQL. Error 0.
When I looked around in the internet i found that plenty of other people had the exact same problem while no helpful solution seemed to be provided by MySQL.com .. I had myself to install and deinstall the server plenty of times with extensive cleaning until I figured out what the problem really was thanks to thourough trial, investigation, and failiure xD , some posts in some forums also helped me a lot.

So what happens with that is that you previously had a MySQL install, and you happened to uninstall it without stopping the windows service first, this prevented it from being removed, when you reinstalled the server a previous instance of the windows service was already in the registry and had the previous install directory as a target.

What you need to do to resolve the problem is to deinstall your current MySQL instance, then run Regedit (start menu, run: "regedit") and remove the mysql service entry in the windows
registery that you will find here: HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services

At this point your machine looks like it has never seen MySQL at all, you can then install it again and it will work without problems, actuallt when retrying with MySQL 5.1 I ran into another problem, the mysqld daemon is launched but it crashed unexpectedly, don't worry about that if it happens, this is a bug and it's not yout fault! I have grabbed an old 4.1 installer from mysql website and it worked wonders, if you are using MySQL for a casual work (expl: running wordpress, joomla, phpbb, ...etc) and if your work is not critical (if you are using windows, sure it is not hahaha) then i suggest you do the same as I did.

If this solves your problem, please link against me to help others get around that as well :)

I also invite you to check out my free homemade cat food recipes blog and my homemade pet food website, these two websites are a huge collection of my best pet food recipes ever, I am sure you will like them a lot.

75 comments:

Anonymous said...

Worked!

This is strange!

Anonymous said...

This did not work for me, I scoured the registry for MySql entries, deleting anything I could find, and it still wont start the service, even after I cancel the configuration wizard and attempt to start manually.

Anonymous said...

Here's another good solution to the problem. Worked well for me:

http://www.andy.name.my/2009/03/cannot-create-windows-service-for-mysqlerror0/

Anonymous said...

Worked - Thanks - i would have been here for hours and hours, expecially as i don't know what i am doing and am just following instructions from a book!

wassim said...

thks it's working perfectly

kindyroot said...

I am glad that it helped so many of you :) you are welcome anytime :)

Anonymous said...

Cannot start Windows service for MySQL Error 0 IN WINDOWS XP SP3
I TRY BUT NOT SUCSSES

Anonymous said...

Worked - Thanks a lot!
Windows 2000 server
Mysql 5.0

Risi said...

Thank you for this, worked a treat :)
now stuck on the next step though
ergh this stuff annoys me

priya said...

Though I have removed all the instances in the above said path.

I am still facing problem to remove the existing the MySql from my system, so that I can install a new one. A file called mysqld is access denied and hance I am unable to remove it. please help me.....

Teo D'Smyrni said...

xmmm... I couldn't find MySQL or anything of this kind in registry after unistall... that is weird, but it is fact... :D and it still doesn't works... I thought she loved me :'(

Anonymous said...

Worked for me as well. Thanks!!

kindyroot said...

priya and Teo D'Smyrni:

have you tried to do this?:
C:\> sc delete mysql

For windows2000 users you will have to download the delsrv.exe tool from http://download.microsoft.com/download/win2000platform/WebPacks/1.00.0.1/NT5/EN-US/delsrv.exe and delete the process with delsrv mysql.

PS: If you like this post, maybe you will like other posts too, I invite you to take a look at my blog main page, see ya:)

Kent McFarland said...

I am pulling my hair out. All of this hasn't worked. ANy more suggestions?

Monica said...

Thanks a lot.It worked for me.Now all learning doors are open up.Thanks again.

Anonymous said...

nice thank you!!!!!

meriem said...

bsr , enfaite jai pa tjr installer mysql sur mon pc alors je sé pa les etapes a suivre pr ne pa tomber ds le meme probleme et desintaller et reinstaller par la suite ,merci de me repondre

Anonymous said...

Thankyou, thankyou, thankyou! It worked like magic for me!

Younis

younis.abed@gmail.com

Anonymous said...

It's simple
http://www.andy.name.my/2009/03/cannot-create-windows-service-for-mysqlerror0/

Edogaru
;)

Anonymous said...

Nothing was working for me, so I installed version 4.1.22 and voila it worked

Anonymous said...

OMG I OWN U MAN ! BIG TIME !

Anonymous said...

it worked but getting 1045 error.

Anonymous said...

ok, this worked for me, but partitionaly...
it says that service is started but than imediatly starts visual studio just-in-time debugger, saying that an unhandled win32 exception occurred in mysqld.exe [1016], the number in brackets is constantly changing...
exe file is in MySql folder
any idea?
please help... :(

Anonymous said...

i cannot find the mysql service entry in the windows registery :(

Ted Chang said...

Installing version 4.1.22 also worked for me. I have had IBM DB2, Oracle, and SQL Server also installed on my machine before.

Ted Chang said...

Installing Version 4.1.22 worked for me. Then I uninstalling it and then installed Version 5+ and did not have the problem above anymore.

Anonymous said...

problem solved for:

Anonymous said...

ok, this worked for me, but partitionaly...
it says that service is started but than imediatly starts visual studio just-in-time debugger, saying that an unhandled win32 exception occurred in mysqld.exe [1016], the number in brackets is constantly changing...
exe file is in MySql folder
any idea?
please help... :(
May 5, 2009 1:40 PM

--

i uninstalled mysql 5.1. completly (including in regedit) and installed 5.0. and it worked

hope this will help someone
:)

nikos said...

din't work for me. I installed ver. 4.1 as well and it worked

Anonymous said...

thank you!

Anonymous said...

Temporarily disable Windows Defender or any other real-time malware scanner ...

Anonymous said...

Hi
This didn't work for me i went through the steps but still get the same error. Are there any other suggestions this is driving me mad and i need to get it.
Thanks

Anonymous said...

i install 4.1 and works

Anonymous said...

I tried installing 4.1 and i got the same problem

kindyroot said...

I am back, glad it worked for so many of you, for others, I am almost certain that if you follow these steps and then install a 4.1 things will work a whole lot better for you!

meriem: pour ne pas avoir ces problèmes il te suffit d'arreter le service MySQL avant de désinstaller, comme ça le désinstalleur peut irradiquer toutes les traces de MySQL sur ta machine!

Anonymous said...

Fantastic....worked first time...thanks !!

Anonymous said...

Hello everyone, I have my win xp installed onto my mac os using vmware. now i'm not sure if my MySQL on mac is affecting my installation on win xp. But i have tried everything but still stuck on this common error at Start service with Cannot create windows service for MySql.Error:0

Guys please come to my rescue, I'm sinking!

Anonymous said...

I found something interesting guys
I uninstalled the MySQL server 6.0 just like you all had, but then installed MySQL server 5.1 and it worked with no problem

Anonymous said...

Thank you soo much!!!It worked out perfectly for me!!!

Anonymous said...

worked great...

gotta make sure you check and delete mysql from all controlsets if there are multiple controlsets

Anonymous said...

One way to tell if this is your problem is that the MySQL configuration wizard will ask for the 'Current Password' if there's an old version of the service still hanging around. If you are not prompted for the current password before entering a new password, then the problem is something else.

benjnunez said...

It's time that mysql.com should get their act together to come up with a standard way to resolve this issue. I had the same problem too.

Anonymous said...

Thanks,it works.

Anonymous said...

After two very frustrating days, I found your solution in google. It worked like a charm! Thank you so much, bro.

omar said...

countless hours spent trying to get mysql 5.1 to install but had problems - uninstalled/cleaned registrys and followed generic tips from the web on this error but all to no joy.

have given mysql 4.1 a go and it has worked first time round!

middle finger goes to the buggy 5.1 version

Omar.

Anonymous said...

in Win2k8 after uninstall delete
C:\ProgramData\MySQL &
C:\Program Files\MySQL

Anonymous said...

Thanks! On my 32-bit Vista machine the instructions worked perfectly.

Anonymous said...

ths doesnt fCKING WORK EITHER GOD DAMMIT I GIFE THE FCK UP

CrashDevil said...

I had the same problem. Tried your hint but still nothing. Disabled my Windows Firewall and other protections. Then I installed the version 5.0... Still nothing. The only way I could make it work was installing the version 4.1 of mysql. I use Windows Vista Business.
Thanks everyone!

Anonymous said...

it's work fine , thx

Brian said...

Problem with install on Windows Vista 64 Bit with either 5.0 or 5.1:

I had problems with the configuration wizard either not starting the service, or not being able to apply the security settings. I tried the above and it wasn't able to solve my problem.
I found another post else where that directed me to change the installation path to something without spaces in it (ie. not the "Program Files" directory.

So I:

- Removed the instance with the Configuration wizard
- Uninstalled MySql
- Deleted references to the MySql service from the registry
- Deleted MySql install directory and data files directory manually
- Then reinstalled MySql into directory c:\MySql5.

Cha-Ching, finally started the service and applied the security settings.

UCSM-Sistemas said...

exelent thank you!

kindyroot said...

Again, I am so glad that things worked for so many of you.
And now, please be as good as to allow me to spam my self and remind you where my homemade cat food recipes blog is located: http://cat-recipes.blogspot.com (need to pay bills heheh).
Have a good day.

Temruk said...

Man, you just safed my from a sleepless night. Thanks a lot, worked fine!

StanProg said...

I had the same problem, but none of the solutions worked. I mean:
- "Remove Instance" from Programs->MySQL->MySQL Server Instance Config Wizard
- sc delete mysql
- installing/reinstalling
- removing registry values for the service, etc...

the only thing that worked was removing the MySQL folder from:
Document and Settings/All Users/Application Data

I think that you'll have to do the things above first, and then to remove the MySQL folder (remember that this folder contents your DBs :), so backup first)

Anonymous said...

Well It never worked for me. I actually checked for the mysql service in the registry but to no avail!
What worked for me was deleting the MySQL folder in Documents and Settings/All Users/Application Data. After uninstalling MySQL from the control panel. I first had to make all folders visible by going to folder options on the windows menu bar to be able to delete that folder from .../Application Data.
But thanks so much for the effort. I do appreciate.

BrightWhiz

Anonymous said...

mysql is a pile of poo with vista x64 sp2

i have never got this program to work with vista

Anonymous said...

I had the same Problem. I did all and no Solution.
I tried to install mysql 5.1.37.
then I tried with 5.1.38 and it works.

Thanks

Anonymous said...

worked in an instant! thnks!

Anonymous said...

I'll second the solution that the only thing that worked was removing the MySQL folder from:
Document and Settings/All Users/Application Data

Din said...

This solved for me: password != root

Anonymous said...

Deleting the MySQL folder in Documents and Settings/All Users/Application Data !!!!

Anonymous said...

thank you very much

Anonymous said...

Deleting the folder: Documents and Settings/All Users/Application Data/MySQL worked for me as well. YAY!

sticmou said...

thanks for the 4.1 solution

Anonymous said...

Deleting the folder....Documents and Settings/All Users/Application Data/MySQL

kiterie said...

Hi,
I don't know a lot about installing MySql but I had many problems while trying to create an instance.
As i finally manage to make it work, i wanted to share with others.
First, my mistake was to try creating an instance by right clicking on MySQL System Tray Monitor and select Actions/Manage MySQL Instances. I created an Instance from there and deleted it, but after, By the wizard, I had the error "Cannot create Windows Service for MySQL.Error:0 " when the wizard try to launch the service. What I did to make it work again:
- Launch the wizard. If it propose to uninstall an instance, do it
- Execute "regedit" and check if there is an entry MySql in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. If there is, delete it
- Execute "services.msc" and check if there is a service named MySql. If there is, launch the window console and execute "sc delete MySQL.exe"
- in the installation folder of MySQL, open the my.ini or my.cnf. Look at the innodb_data_home_dir variable and delete this direction on your computer (or it's new content).
- in the installation folder, go to the repository /data and delete all the log files (for me:ib_logfile0, ib_logfile1 and ibdata1)

And launch the wizard again.
If you still have a problem, you may find a clue on watching the .err file in the previous data repository.
Good luck!! :)

Ronnie said...

Another "Deleting the folder....Documents and Settings/All Users/Application Data/MySQL" success story. Man, it shouldn't be that tough!

Yommie said...

didnt work at first. then "C:\>sc delete mysql" gave success message and a reinstall worked fine. Thanks

Anonymous said...

Thanks, that was the neede answer

hedgy said...

thanks a lot, after deleting everything what's about mysql it finally worked! :D

An said...

REALLY THANK YOU! I just needed to delete register keys no reinstall at all and everything worked!

Anonymous said...

thks. it works for me. but you need to reboot your system once you delete the service folder. Then reinstall mysql server.
thank u.

Anonymous said...

When I ran into this problem it was enough to run the Server Instance Config Wisard as Administrator.
Then it could reinstall the service without problems

Anonymous said...

Thax, this worked for me.

Nga said...

Hello,

I am having the same error. I went to check for any mysql parameters left in regedit but I've seen none of them.
Would someone tell me what I've missed please?? 'Coz it didn't work for me :((
Thank you very much