Mar
11

Cannot create Windows Service for MySQL.Error:0

I was installing MySQL on a Windows 2008 64bits machine today. The installation went smooth as usual, I got the MySQL configuration screen wizard at the end of the MySQL installation and went through filling in those service configuration details, MySQL root ..etc. However, at the end of the execution part where it writes the changes, it shows the following message during the attempt to start the MySQL services.

Cannot create Windows Service for MySQL.Error:0

It was my first time getting this message as I have been setting up MySQL for lots of Windows server without any issues on the past. Here’s what I did to get it resolve:

1. Start > All Programs >MySQL > MySQL Server 5.x > MySQL Server Instance Config Wizard.
2. Hit the Next and select the options “Remove Instance” and complete the process.
3. Fire up the MySQL Server Instance Config again, this time select the Configure Instance with Standard Configuration and go through the setup again. It should get your MySQL configured again.

The possible cause of the error is due to the MySQL Services has been installed and started on your server’s prior to the configuration by MySQL. Removing the installed instances and reset it up will help to resolve this.

129 Comments to “Cannot create Windows Service for MySQL.Error:0”

  • FJ June 16, 2009 at 6:32 am

    nope, this stuff didn’t work 4 me!!!!

    i’m working on windows 7 beta.
    Let’s see postgresql can do it!

  • abin thomas June 16, 2009 at 10:13 pm

    thanks a lot!! it really worked for me..

  • Nate June 19, 2009 at 12:53 am

    If this doesnt work go to C:\Documents and Settings\All Users\Application Data (Hidden Folder) and check to see if there is a MySQL directory. If so, delete it and try to reinstall it again, worked for me.

  • barbara June 19, 2009 at 5:35 am

    MUCHAS GRACIAS! your fix was the simplest and easiest of several i tried! i wish i had found yours first!

  • Vivek June 20, 2009 at 7:48 am

    Thanks!!!! Thanks this worked…Great Even the problem of Error 1045 Resloved…Great..I Unistalled every thing removed the Program Data folder..(Vista)..And then followed Ur Steps..And it worked…

  • Armand June 24, 2009 at 7:37 pm

    Hi Andy,

    worked like a charm !
    thanks a lot,

  • Andrew June 26, 2009 at 12:17 pm

    Cool man. The number of posts on the mysql site was huge. I found the “Solution is here” and found this. Thanks

  • Tore Gard Andersn June 28, 2009 at 9:45 pm

    Did not work for me on a windows 2008 server and mysql-5.1.35-winx64.

  • Rhoderick June 30, 2009 at 2:47 pm

    wow thanks…this works perfectly for me…

  • tracu July 1, 2009 at 3:46 pm

    Well if this dosen`t work for you, try looking in your firewall programs acces and grant priveleges. My firewall blocked it and that`s why that Error 0 appeared.

  • Sam Howe July 1, 2009 at 10:44 pm

    Hi, I fixed this (on Server 2008 STD 32bit) by

    1) removing the instance using the MySQL Server Instance Config Wizard

    2) uninstall MYSQL completely.

    3) Reinstall MYSQL, but do a custom install and change Install Directory to something like C:\MySQL\

    4) Complete the installation and run the configuration utlity again.

    It seems like the config can’t handle spaces in the program directory location, e.g. C:\Program Files\MySQL\MySQL Server 5.1 = too many spaces.

    hope that helps.

  • Sam July 1, 2009 at 10:49 pm

    Seems the config utility cannot handle spaces in the program directory location, e.g.

    C:\Program Files\MySQL\MySQL Server 5.1 = too many spaces.

    hope that helps. Wasted 2 hours tring to figure this out!!

  • CrashDevil July 6, 2009 at 6:24 am

    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!

  • Chris July 8, 2009 at 2:17 am

    After searching everywhere without hope and get crazy finally i found the solution.
    1) First, uninstall MySQL server if is installed.
    2) Close any Antivirus – Firewall application you have.
    3) Make sure you have enabled Windows firewall and give exception to MySQL on port 3306.
    This is important, so make sure you do that.
    4) Install the Server.
    Hopefully you did it…

    For some reason all most, every Antivirus i test cut’s Configuration attempt to open the
    port 3306.

  • volker July 8, 2009 at 6:57 am

    Thanks, worked for me, so simple!!!!
    cheers vb

  • sandy July 8, 2009 at 1:40 pm

    didnt worked for me , though i did the same , any more suggestions.

  • De July 13, 2009 at 9:04 pm

    many thanks!

  • breeze1974 July 15, 2009 at 9:12 pm

    It did not work for me. Do I need to remove any registry keys.? My firewall on windows xp sp3 has been disabled. There are no mysql services running under services mmc.
    Please Please assist

  • Henrik July 16, 2009 at 6:49 pm

    Thanks!

  • MA July 16, 2009 at 9:50 pm

    Nope, doesn’t work for me . I have tried the exact same steps mentioned in the blog but still get the same error when I try to reconfigure the instance.

    “Cannot start service: Error 0″

    I have Windows XP + MySql 5.1.36

    The steps in the blog probably work for older versions of MySQL so I’m going to try and instal something older.

  • Arash July 18, 2009 at 4:04 am

    Thanks a lot

  • Tom July 19, 2009 at 11:43 am

    Excellent solution! Thanks, Andy … it worked like a gem. I was installing MySQL V5.1.36-32 on a Windows Vista 64.

  • Tim July 21, 2009 at 2:20 am

    Thanks Much!

  • Kevin Guthrie July 21, 2009 at 5:38 am

    Thanks for the “sc delete mysql” command – it was the last piece of the puzzle for me!

  • Mark-Jax July 22, 2009 at 12:41 am

    Works fine, lasts a long time.

    But… why on an original install would this ever occur? Makes no sense.

  • Satya July 22, 2009 at 8:31 am

    Oh well it worked! I was trying to install MYSQL since so many weeks and finally today I got it installed thanks a lottt :)

  • Glen July 23, 2009 at 11:56 am

    I had similar problems. Details of the problem were found in the Windows Event log and the xxxxx.err file in the C:\Program Files\MySQL\MySQL Server 5.0\data folder.

    It turns out that the ib_logfile0 file was not being created correctly, saying it was 30mb but the configuration file specified 10mb. I changed the configuration file to ask for 30mb, and deleted the ib_logfile0 files and the data file. After that, the installation worked.

  • Jennifer B. July 24, 2009 at 5:50 am

    THANK YOU so much! :)

  • Ryan July 24, 2009 at 12:16 pm

    Neat!. Thank you.

  • gooddy July 24, 2009 at 3:57 pm

    thanks men,you rock.

  • Debty July 27, 2009 at 5:14 am

    Ahaan… I will follow.

  • rosa July 28, 2009 at 2:45 am

    thanks!

  • Nilanka July 30, 2009 at 11:38 pm

    works like a peach… thanks mate

  • Etukeni August 3, 2009 at 7:45 pm

    I have followed your solution to the end but it did not work.
    What can really be the problem.
    Cus i can feel that its a very easy solution.

  • Jeff Morris August 4, 2009 at 11:49 pm

    I searched the internet for the past few hours to find everyone dancing around the problem. I’m sure glad I found this, Thanks for the help! Your simple fix is amazing.

  • Tony August 4, 2009 at 11:55 pm

    This fix failed for me twice. On the third try I restarted the computer after step 2. Then ran step 3 and it worked. I hope this helps others. Thanks

  • pskavita August 5, 2009 at 5:46 am

    Hi Thanks a lot…this really helped..else i would be stuck at my work place!!!

  • Sam August 6, 2009 at 9:04 pm

    Hey thanks a lot for this helpful tip. After about 5 attempts i got it to work. This is just a little follow up for the next person that reads it. If you are creating a “database” you will need to input a password and try again. If that doesn’t work, just keep at it until it does, they say third time’s the charm, although mine was the 5th. Good going. Helped a lot, 5 Diamond Stars for you.

  • simon August 9, 2009 at 4:00 am

    thanks, it worked

  • chinmoy paul August 10, 2009 at 9:57 am

    cool man!! it works like majic!! hats off too you!! thank you soooooooooo much.!!

  • Andrei August 15, 2009 at 6:39 am

    I just wanted to say THANKS!
    Andrei

  • Anthony August 18, 2009 at 1:46 am

    worked perfect thanks!

  • Raif August 18, 2009 at 10:56 am

    Thanks so much. Just what I needed.

  • russ August 18, 2009 at 10:34 pm

    This was helpful but did not solve my problem. I tracked my problem down by looking at the error messages in Control Panel –> Administrative Tools –> Event Viewer. The first time I installed MySQL I selected InnoDB storage engine (under wizards ‘Detailed Configuration’) which the error log reported as unsupported. After reconfiguring with the MyISAM storage engine then MySQL service started fine.

  • Sayth August 19, 2009 at 11:33 pm

    Yes it does work, but then I needed to rerun the detailed configuration to get the settings I desired.

    when you do this you receive the same error again so whats the point in a detailed config if it always fails?

  • Craig Goodrich August 20, 2009 at 3:25 am

    OK, I followed the instructions above and reran the wiz and still got the “can’t start service” — BUT on a hunch I checked with XP’s Service manager and MySQL was in fact running.

    Theory: Between McAfee and dozens of other things, the service does get installed and started but the wiz times out waiting for some confirmation which never comes.

    So then I rerun the wiz to REconfigure. When you get to the “old password”, try blank BECAUSE it blew up last time before writing the security stuff, enter the new password you want — probably the same as you put in when it blew up last time.

    Finally I’m good…

  • tired August 21, 2009 at 3:13 am

    I’ve tried this several times, searching the entire registry for MYSQL entries, search my entire harddrive for MYSQL files/folders… checked the services.msc for mysql services running. deleted everything related to MYSQL. Some how. I cannot reinstall this thing.

    I’ve tried all examples listed. I even searched the web for possible solutions much of them similar to this one. None have worked. I’m starting to think my only recourse is a fully wipe at this point of frustration.

  • Grateful Web August 21, 2009 at 4:57 am

    This solution worked for me! I got the error at the end of the MySQL Server Instance Config process. I did NOT close out the MySQL Server Instance Config while searching out a solution/fix. I found this page, followed the suggestions above (use the MySQL Server Instance Config Wizard), then went to my STILL OPEN “MySQL Server Instance Config process”, which was still showing the error (Cannot create Windows Service for MySQL.Error:0), clicked BACK once, and then executed again. Problem Solved!

  • sharon August 24, 2009 at 3:25 am

    ah great! it worked thanx : ) next one is 1045 error though..huhu..
    cheers : )

  • danny August 24, 2009 at 4:20 pm

    Initially it also didn’t work for me, but then,
    I changed the name of the service from MySql to MySql5, and then it worked.

    Thanks!

Post comment