[英]Change IIS user credentials for ASP.NET app and SQL database
IIS 7.5, ASP.NET application + MS SQL database IIS 7.5,ASP.NET 应用程序 + MS SQL 数据库
A website is in C:\\inetpub\\wwwroot\\AppFolder网站位于 C:\\inetpub\\wwwroot\\AppFolder
Windows authentication is allowed允许 Windows 身份验证
SQL connection string contains user name and password SQL 连接字符串包含用户名和密码
Trying to open a website试图打开一个网站
Cannot open database requested by the login.无法打开登录请求的数据库。 The login failed.
登录失败。 Login failed for user 'IIS APPPOOL\\DefaultAppPool'
用户“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).
我的 Web 应用程序设置为使用特定的用户名和密码来访问数据库 (web.config)。
The problem is that I don't have IIS Manager Users feature.问题是我没有IIS 管理器用户功能。 I have installed IIS completely, all services and checkboxes enabled, but still no such feature.
我已经完全安装了 IIS,启用了所有服务和复选框,但仍然没有这样的功能。
Configure this IIS user account to successfully access the web app配置此 IIS 用户帐户以成功访问 Web 应用程序
Create a sql user and configure it to access that one database.创建一个 sql 用户并将其配置为访问该数据库。 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.运行应用程序的用户(windows 帐户)和访问数据库的用户不是一回事。 Keep them separate.
将它们分开。 One for db, one for app pool.
一个用于数据库,一个用于应用程序池。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.