SQL Server user ' NT authority\iusr ' logon failed

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

Open the website today, suddenly reported this error, usually good

cannot open database "JMECC" requested by the login. The login failed.
Login failed for user ' NT authority\iusr '.

My connection string is this, with Windows Authentication logon:

Data source=.\sqlexpress;initial catalog=jmecc;integrated security=true;multipleactiveresultsets=true;application Name=entityframework

think of a recent just modified a Web. config configuration, that is, add the following sentence in Web. config, which is used to impersonate the IIS authentication account, if no user name is specified, it is used by default NT authority\iusr

<identity impersonate= "true"/>

Because the user has insufficient permissions to log on to the specified database, Windows authentication fails with three solutions:

1. You can change the connection string to user name (SA) and password login, if there is no permission to operate the server recommend this scheme;

2. Or comment out this sentence from within the system.web, but may affect other functions, such as file operation;

3. Open SQL Server Management Studio, Security-Logins, right-click New login .... login name to enter NT AUTHORITY\IUSR -OK

On the new user NT authority\iusr, right-click Properties----Server Roles Select public and sysadmin---user Mapping Select your database in the Default S Chema column fill in the dbo--OK!

(I do not know why this editor can not upload pictures, so no)

SQL Server user ' NT authority\iusr ' logon failed

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.