Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

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

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

3 Answers 3

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;
share|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

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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