Thea Burger's Blog

Wouldn't you like to know...

News

Photo's!!!

About me

I'm Reading: General Blogs

I'm Reading: Technical Blogs

SQL Server Service Did Not Start Due to a Logon Failure

This is an error that I have received a couple of times previously. The first time I couldn't understand what was going on, as I didn't change my SQL password or anything...
After some investigation I saw that this is due to SQL Server logging on with a domain account and my domain password expired and I changed it.

Quickfix:
1. Go to Services in Administrative tools.
2. Open MSSQLSERVER and click on the Log On type.
3. Enter your domain password.

And voila! - your SQL is back to normal.

What you should probably do: (I am guessing here, couldn't find the real solution)
Create a seperate domain account for SQL Server.
Grant this user permission to the SQL Server directory, the .mdf, .ldf files, access to the SQL registry keys.
And let the service log in as this user.  

I am open for suggestions on the real solution or the best practise for this.... :)

Comments

matt@dotnet.org.za (matt) said:

I would use a Local service account (with minimal domain privileges; but Administrative local) and set the password to never expire.

Check my blog for the full solution straight from the SQL Resource Kit.
# June 10, 2004 10:24 AM

cbuit@hotmail.com (Christiaan Buitendach) said:

Just make sure that the user account you create / use for the SQL service does not have unnessesary rights on the domain and / or server. This account could be attacked to compromise the security of your network and be used as a easy way into your network.
# June 10, 2004 1:02 PM

Colin said:

I had a similar one that stumped me for a while. Trying to restore a backup of a database, but the local account that sqlserver was running under didn't have permission to access the directory where the backup file was...
# June 10, 2004 4:25 PM

john.e.boy said:

Thea,

Thank you!! I googled and found you site (nice!) and your brilliant answer to my problem - thanks again.

john.e.boy
# August 13, 2004 12:15 PM

Trickster said:

Google is my friend !
Thanks for the simple and direct solution to this problem.
# September 8, 2004 5:42 PM

Shabeer Mukkan said:

Thnks, i cleared this problem

Bye
Shabeer
# October 14, 2004 7:07 AM

tony said:

hey, thanks! got your solution off google, like an idiot i removed active directory because i didn't want to go through the hassle of changing the domain name which i had entered wrong during the wizard. now that i was trying to log onto a domain that no longer existed, my sql server needed the new admin password. thanks again!
# November 24, 2004 5:39 AM

Gary Puerini said:

yup, worked for me too!! Thanks much!
# January 18, 2005 11:24 PM

Russ @ Instant said:

AWESOME JOB DOOD! Google'd and gotcha! You rule! Woot!
# February 2, 2005 12:20 AM

Joe SqlSvr said:

That didn't help much
# March 31, 2005 12:20 AM

Charles said:

THANK YOU!
# May 12, 2005 10:26 PM

PuPu said:

Thanks for posting this. No more login problems. I had never even thought to look into the SQL Service properties. :|
# May 30, 2005 5:23 PM

Vartika Seth said:

Sorry but I was not able to get the exact cause of the problem why the error:"Service did not start due to logon failure" occured.

Please explain me the exact cause.

Thanks
Vartika
# June 3, 2005 9:00 AM

Vartika Seth said:

I too googled for the same and got the explaination but my query is that why it happened so that while I was installing SQL Server 2000 developer edition on Win. 2000 Professional OS I din't faced any problem like this but during installation on Win. XP Professional edition I faced this.

Please clearify the point.

Thanks
Vartika
vartika.seth@gmail.som
# June 3, 2005 9:09 AM

Thea Burger said:

"SQL Server logging on with a domain account and my domain password expired " this is why it happened to me. I don't the problem is the OS that you are running.
# June 5, 2005 10:48 AM

Anil Kumar said:

I am facing same type of problem. But In my case postmaster service is creating problem. After every restart whenever I try to start this service. It result "The service did not start due to a logon failure" and when I go on to "Log On" tab of service. Every time I found that the passsword of the related user account under which this service is to execute has been changed some how. So every time I correct this password and click APPLY, System confirms with message "[User] has been giving logon as service right". After doing all this service start normally.

But I am not able to find how every time password gets automatically changed. What's going worng ????

Thanks
Anil
kumar.anil@tatainfotech.com
# July 18, 2005 11:43 AM

JAVIER @ visualnetdesign . com said:

Microsoft SQL Server ODBC Driver Version 03.85.1117

Running connectivity tests...

Attempting connection
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
TESTS FAILED!

this is the error i get i cannot connect to the sql server from a remote computer. my other server works fine but i must have some persmissions problem of some kind.
i tried to look around but everything seems fine.
here is my email just in case. just take off the spaces. thanks
javier @ vndx . com
# August 9, 2005 5:26 PM

Hollywood said:

Anil Kumar wrote:
>>every time I correct this password and click APPLY, System confirms with message "[User] has been giving logon as service right". After doing all this service start normally.<<

This has been happening to us too. Apparently 2k3 server SP1 fixes this. Can anyone confirm?
# August 31, 2005 4:27 PM

Mark Ross said:

Thank you so much for this post it was so helpful !!!
# November 2, 2005 5:12 AM

Digambar said:

Thanks !!! It worked for me.
# November 5, 2005 11:02 AM

Farayola Gabriel said:

Attempting connection
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
TESTS FAILED!

this is the error i get i cannot connect to the sql server from a remote computer. my other server works fine but i must have some persmissions problem of some kind.
i tried to look around but everything seems fine.
here is my email just in case. just take off the spaces. thanks gabbyzfriyola @ yahoo . com
# November 8, 2005 9:12 PM

titus said:

found you via Google and you answer solved my problem! Mahalo!
# November 12, 2005 1:09 AM

rocky said:

hey..this is simple and straight solution...worked out...
Thanks dude
# November 13, 2005 3:14 PM

Erika said:

Thanks! This is a great blog entry! You saved my life :)
# December 7, 2005 5:06 AM

Myndkrime said:

> After every restart whenever I try to start this service. It >result "The service did not start due to a logon failure" >and when I go on to "Log On" tab of service. Every time I >found that the passsword of the related user account >under which this service is to execute has been changed >some how. So every time I correct this password and click >APPLY, System confirms with message "[User] has been >giving logon as service right". After doing all this service >start normally.

I have had the same problem running on a Window 2K Advanced server. Possible issue could be with the "Logon as Service", check locally and see what the settings are and if the account you are trying to use has been added. Also you can see what settings are in place "locally" and the actual settings. If GPO are being used in the domain, the settings may become overwritten by the GPO so changes will have to be made to the GPO to include the domain account being used.

Also, like previously stated, that the account being used had "full control" permissions over the data locations for SQL server and also the following registry settings.

Full Control permission applies to the following keys and all child keys:
• For a named instance:
HKEY_LOCAL_MACHINE\Software\Clients\Mail

HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\80

HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\<Instancename>
• For a default instance:
HKEY_LOCAL_MACHINE\Software\Clients\Mail

HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\80

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Cluster

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Providers

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Replication

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Setup

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\SQLServerAgent

HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Tracking

Per Microsoft:
http://support.microsoft.com/?id=283811
# December 19, 2005 6:50 PM

Varma said:

Hi,

It is working..great....Thanks for google and major partner of this site.

Regards

D.V.S.Varma
# January 10, 2006 10:58 AM

SQL Nub said:

Thanks. I had changed the password for the Windows account used to start SQL Server and coming here quickly gave me the right location of where to also change the stored password of the account used to start SQL Server
# January 25, 2006 8:31 PM

vimal said:

waw!!Really it was helpful Thanks a lot for nice information
Done the Following:
ControlPannel-->AdminstrativeTools-->Services-->MSSQL Service-Lon on as
# January 30, 2006 8:54 AM

Robert said:

Thank the Lord for you and your answer. You just saved me about 15 hours of work!
# February 8, 2006 8:47 AM

Kris said:

Thanks so much for this. It saved me a ton of time!
# March 14, 2006 5:37 PM

Rahul said:

thanks it helped us gr8...
# March 21, 2006 6:24 PM

David said:

I must agree with all that used google, because my gray was turning white and I deleted and registered a new server group when I should have googled.

Thanks and Keep it up!!

Kudos!!

I'm dying my hair in the morning.
# April 6, 2006 6:24 AM

Chris said:

I'll add my name to the list... Google and your site saved me.
# May 3, 2006 1:13 AM

Jack said:

Thanks Much !
# May 13, 2006 9:45 PM

sandip kharde said:

Thanks it helped us really nice info.....
# May 15, 2006 9:32 AM

azam ali said:

Worked 100% You are a life saver mate. I was shitting in my pants.

But the odd thing is that i changed the administrator password 5 weeks ago when i when on holidays, that did not affect the sql server from running. However, friday night the server was asking to reboot to apply service packs which i did and then server stopped running. So it appears that the reboot of the sql server is when password change will take effect.

Thanks again

Azam
# May 15, 2006 10:55 AM

John K said:

Thanks!  Google is awesome and so was your easy solution to the problem.
# May 28, 2006 8:14 AM

manikandan surendranath said:

Never thought of properties page. Thanks to Google and this site. I was able to reduce the downtime.
# June 22, 2006 4:54 AM

Gaurav said:

THANKS A TON !!!
So greatfull to get this problem solved. goofle is really great... 3 days of asking and begging guru's and today I solve it in a sec.
thanks for the great posting.

Regards
Gaurav Mathur
# June 28, 2006 6:52 AM

Gear said:

He huh what is a domain password and how do I know what I have to enter there ?
# July 19, 2006 2:52 PM

shyam said:

Dear sir in case if Domain Password has been forgoton so wht should be then.
# August 28, 2006 2:08 PM

Preeti said:

This was a great solution!
# August 29, 2006 10:01 PM

arn said:

that was awesome man.. i owe you two hours of my life :)
# September 14, 2006 4:43 AM

Jay said:

Thanks much! I was scared when SQL gave this error. Your quick solution worked.
# October 4, 2006 7:47 PM

replication wizard does not start sql server said:

Pingback from  replication wizard does not start sql server

# June 11, 2008 9:04 AM