Getting "System error 5 has occurred" error when starting SQL service in Windows 7.

I'm trying to restart SQL server, which I am used to doing via the following command line statements:

  net stop mssqlserver
  net start mssqlserver

However I'm on a new Windows 7 machine, and am getting the following error when I try:

  net start mssqlserver
  System error 5 has occurred.

  Access is denied.

My account is part of the administrator group, and I can restart normally via the Services control panel.  I have tried turning the UAC settings all the way down, but still get this message.

(This also fails if I try using PowerShell.)

What do I need to do to be able to restart services via the command line?



Question Info

Last updated July 2, 2019 Views 33,786 Applies to:
I had exactly the same problem:
1. new installation of windows 7
2. net start MSSQLSERVER fails with "Access denied" from command window, but works when started by Service Control Manager
3. logged in as a user in Administrators group - same account as used for automatic startup
4. I tried the Registry steps above. They did not work.
5. I tried setting my account UAC to the lowest possible level as recommended in some other forum. It also did not work.

I was amazed by the number of desperate posts of people with similar problems - and seemingly few resolutions out there. I used Windows 3.1, Windows NT, Windows Server 2003 and Windows XP some years back and then switched to Max OS X and Linux. Now I am struggling to get used to this type of Windows problem again, (sigh).

Anyway, a colleague of mine just walked in and gave me an easy workaround. He says the problem is that your "administrator" user is not "administrator enough" - go figure. Basically, being in the Administrators group is not the same as being THE Administrator account.
1. Create a shortcut for "cmd.exe" on your desktop.
2. Right click the shortcut and select "Run as Administrator"
3. In the command window that opens, "net start MSSQLSERVER" works

Good. So now I can get going on that restart-SQL-Server-when-it-decides-to-die script for our customer site. Another sad Microsoft tale...

47 people were helped by this reply


Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.