Page 1 of 1

ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 06:52
by mattquiros
Hey guys, I first installed XAMPP with the installer for Windows and uninstalled it using the .exe file in the C:\xampp folder (I forgot what that was called). Then some folders were left over so I deleted them manually, just by pressing Ctrl+A and Shift+Del. Then I downloaded the XAMPP zip file and followed the instructions for installing without the installer, and now that I've set up everything, Apache would run in xampp-control but not MySQL. Whenever I click on "Start" the message "ERROR: MySql service not started [-1]" always appears. What do I do?

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:05
by Sharley
There may be a MySQL Windows Service still installed from your last installation that you failed to Stop before deleting the XAMPP folder.

Check using the Windows Service Manager either from the XAMPP Control Panel or from the Administrators menu in Windows.

If you find one then simply disable it - reboot and try again.

You could also try running the mysql_uninstallservice.bat file from the mysql folder, then try and start MySQL again from the Control Panel but do not tick the Svc box.

Often just a reboot will fix things also.


Here are some instruction if you need them in the future:
viewtopic.php?p=179699#p179699

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:22
by mattquiros
Thanks! I already restarted my computer and was surprised to see MySQL running in the XAMPP Control Panel, and when I clicked stopped, I got an error message similar to the above and couldn't stop it. So when I checked the SCM, I stopped the "mysql" one manually. Looks like I'll be starting and stopping MySQL from there. Is that normal?

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:26
by Sharley
No, stop MySQL and remove the tick in the Svc check box in the Control Panel or run the bat file I mentioned above - this will remove the entry in the SCM and then you can use the Control Panel in future.

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:32
by mattquiros
Hmm, I stopped mysql in the SCM and tried to run the mysql_uninstallservice.bat, but it said "Install/Remove of the Service Denied!" I also tried unchecking the box beside MySQL and clicking OK in the dialog box that appeared, but nothing seems to have happened.

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:41
by Sharley
OK we are not beaten yet :)

Stop MySQL before trying to run the bat file.

You can also follow these instructions to remove it safely from the registry.

Stop MySQL if you can and close the Control Panel.

Open a command prompt
Click start
Click on Run...
Type: cmd.exe

Type:
sc delete mysql
Click OK

Open the Control Panel and try and start MySQL again but it is best not to have any ticks in the Svc boxes unless you absolutely know you want any of your web server to start when Windows starts and this is not recommended.

You can reboot again just to make sure it has gone.

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:51
by mattquiros
Oh god, I'm afraid this is the message that comes up after typing "sc delete mysql" and this message appears:

[SC] OpenService FAILED 5:

Access is denied.

:(

I did a little more Googling about the problem and I found this: http://drupal.org/node/224342#comment-3322550 Do you think it's going to help? Thanks so much.

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:54
by Sharley
Sounds like you are not logged into Windows as an Administrator.

Right click on the bat file and select to run as an administrator and if you want to run a web server then consider logging into Windows as an Administrator.

Re: ERROR: MySql service not started [-1]

PostPosted: 16. May 2011 07:57
by mattquiros
Yes, I don't think I'm running admin. I'm using a computer from the office. :) Anyway, that last tip worked! Thanks a lot Ms. Sharley. :D