I'm trying to install yet another forum on my local machine, and while I'm configuring the database connection I got this message

Failed to connect:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

I have served Google and I found that I have to add network service Login to my SQL server and then add this user to my database

I don't know if this is true or false but anyway I don't know hot to add the network service to my SQL server

please help as soon as you can

Thanks in Advance

link|improve this question
feedback

migrated from stackoverflow.com Jun 13 '11 at 12:51

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 4 down vote accepted

This is the Identity of the Appplication Pool in IIS

Local database, same box as IIS:

CREATE LOGIN [NT AUTHORITY\NETWORK SERVICE] FROM WINDOWS;

Local or remote database in Active Directory domain

CREATE LOGIN [myDomain\ServerName$] FROM WINDOWS;
link|improve this answer
1  
Personally, I'd recommend changing the application pool identity to a dedicated account for the site if using Windows authentication, but yes, this should work. – db2 Jun 13 '11 at 13:12
@db2: agree: this is I do. – gbn Jun 13 '11 at 13:20
feedback

Goto SQL Server Management Studio => Security. Right click on Logins => New Login.
In Login name type NT AUTHORITY\NETWORK SERVICE. Click ok.

Now click on your yaf database => Security. Right click on users => New User...
Fill in the username your desired name. in Login name type NT AUTHORITY\NETWORK SERVICE. Choose db_owner in Schemas and Database Role Membership click ok.

You should be able to login to your databse with your desired username and password.

link|improve this answer
feedback

Yes, I agree with gbn and Kamyar. You can preview the example/tutorial on here.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.