The login failed
-
Wednesday, August 08, 2012 3:53 PM
I have two websites. Both websites work out of the same database. The Connectionstring in the web.config files are identical.
This morning I noticed the server had re-booted.
When accessing the first website, all is well.
When accessing the second website, I get the following:
Cannot open database "store" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.Any thoughts?
All Replies
-
Wednesday, August 08, 2012 4:32 PM
which authentication mode is used to connect the database
windows authentication
sql server and windows authentication
Ramesh Babu Vavilla MCTS,MSBI
-
Thursday, August 09, 2012 12:59 AMWindows authentication
Otis
-
Thursday, August 09, 2012 5:08 AM
It seems any application is using NT AUTHORITY\NETWORK SERVICE to connect & NT AUTHORITY\NETWORK SERVICE is not having rights on store database.
You can try to provide db_owner rights on store database to NT AUTHORITY\NETWORK SERVICE.
But using NT AUTHORITY\NETWORK SERVICE user for connectivity is security violation, you should not use it.
Please click the Mark as Answer or Vote As Helpful if a post solves your problem or is helpful!
-
Thursday, August 09, 2012 5:14 AM
Hi,
Do not assign db_owner right to the worker process! This is such a bad idea. You may assign the least privilege to it such as EXEC. If you are in a domain environment you may change your application pool identity to a domain user and grant access to that user the minimum privilege in SQL. If you are using the computer account, that is also fine, but not as easy to manage it as a domain account. Rohit, it is not a "security violation".
I hope it helps.
J.
There are 10 type of people. Those who understand binary and those who do not.
-
Thursday, August 09, 2012 8:57 AM
As we are unware about the access required by NETWORK SERVICE on database so giving DBO rights to get things work. Assigning a a DBO privileges to NETWORK SERVICE is security violation as mostly all security standard. Change the application / Service startup account to to dedicated Service account and then give these privileges to dedicated service / application account is recomended.
Please click the Mark as Answer or Vote As Helpful if a post solves your problem or is helpful!
-
Tuesday, August 14, 2012 12:10 PM
Rohit,
Please read my post again! What I'm saying is using the computer account is fine, but not as easy to manage as a domain user. I'm also against giving db_owner permission. If you read back your own post, you proposed to assign db_owner permission ;-)
Janos
There are 10 type of people. Those who understand binary and those who do not.
-
Wednesday, August 15, 2012 3:33 PM
Looks like your web application is connecting using 'NT AUTHORITY\NETWORK SERVICE'. Add it as a login to SQL Server and grant it necessary rights to store database.Regards,
Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)
http://basitaalishan.com
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.- Proposed As Answer by JamesYiModerator Friday, August 17, 2012 1:32 AM
- Marked As Answer by Maggie LuoMicrosoft Contingent Staff, Moderator Tuesday, August 21, 2012 8:01 PM

