User nt authority \ network service logon Failure Solution

Source: Internet
Author: User
Tags microsoft sql server management studio

The first time I used SQL Server 2008 for ASP. NET development under Vista's flagship version, I encountered a lot of confusing problems. One of them was the "user NT AUTHORITY \ NETWORK SERVICE login failure" problem. At first, I thought the database connection string was wrong. After repeated checks, I found that this was not the crux of the problem. After checking the information, it is found that ASP under Vista. NET Running Account changed to Network Service (also in Windows Server 2003), while ASP.. NET Running Account is ASPNET. No wonder so many people do not like to use Vista.

Check the solution again. The consistent solution on the internet is written in the old version of SQL Server 2000, which is not applicable to SQL Server 2005/2008. The following is the correct solution in SQL Server 2008 after repeated experiments:

(1) configure the Vista system. [Desktop]-> [computer]-> right-click-> [management]-> Expand "local user and group"-> select "group"-> double-click" in the displayed window, click "add... "button-> in the pop-up" Select User "window, click" advanced... "button-> click" Search now "-> select" Network Service "in the following" Search Results "and click" OK "->" OK "->" OK ""button->" application "button. Now, the user configuration of Vista is complete.

(2) Configure SQL Server 2008. Open "Microsoft SQL Server Management Studio", find the database instance you want to configure, and expand-> Expand "security"-> right-click the "user" folder, select "new user"-> click "..." next to the "Login Name" text box. "button-> click the" Browse "button in the" select login name "window-> select [nt authority \ network service] in the" search object "window (checked in front) -> "OK"-> "OK"-> enter a name in the "user name" text box above the "Login Name" text box (this can be written as needed) -> "OK" button. So far, the database configuration is complete.

(3) re-run the ASP. NET program. The authentication type of the database must be "Windows Authentication" and "Allow access". The problem is solved.

PS: an important difference between SQL Server 2008 and SQL Server 2000 is that the former does not have a "login" sub-folder in the "Security" folder, therefore, many articles taking SQL Server 2000 as an example do not apply in SQL Server 2008.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.