简体   繁体   中英

Change IIS user credentials for ASP.NET app and SQL database

IIS 7.5, ASP.NET application + MS SQL database

A website is in C:\\inetpub\\wwwroot\\AppFolder

Windows authentication is allowed

SQL connection string contains user name and password

Trying to open a website

Cannot open database requested by the login. The login failed. Login failed for user 'IIS APPPOOL\\DefaultAppPool'

Looks like wrong user credentials. My web application is set to use specific user name and password to access the database (web.config).

The problem is that I don't have IIS Manager Users feature. I have installed IIS completely, all services and checkboxes enabled, but still no such feature.

Configure this IIS user account to successfully access the web app

Create a sql user and configure it to access that one database. Give it enough rights to be able to do what it needs to do.

Change your connection string so it contains those credentials. That's all you need.

At the moment it tries the user setup under your app pool and that clearly is not going to work. So, if you want to change the app user look at the advanced settings of your App Pool.

-edited-

the user the app is running under ( windows account ) and the user who accesses the database are not the same thing. Keep them separate. One for db, one for app pool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM