简体   繁体   English

更改 ASP.NET 应用程序和 SQL 数据库的 IIS 用户凭据

[英]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.

相关问题 asp.net Web应用程序返回IIS信息而不是当前用户凭据 - asp.net web app returning IIS info instead of current user credentials IIS 无法将 Windows 凭据传递到 SQL Server for ASP.NET Core 应用程序 - IIS fails to pass windows credentials through to SQL Server for ASP.NET Core app 如何在ASP.NET Forms身份验证中针对SQL数据库仔细检查用户凭据 - How to double-check user credentials against SQL database in ASP.NET Forms Authentication IIS 7.5和ASP.NET凭据 - IIS 7.5 and ASP.NET credentials 如何在ASP.NET中禁用IIS凭据 - How to disable IIS credentials in ASP.NET 为asp.net 3.5数据库应用程序安装和配置sql server和IIS [基本] - installing and configuring sql server and IIS for asp.net 3.5 database app [basic] 在IIS APP_DATA文件夹中不在远程SQL Server本地创建的ASP.NET EF数据库 - ASP.NET EF database created local to remote SQL Server NOT in the IIS APP_DATA folder IIS / ASP.NET使用未知用户连接到SQL Server - IIS/ASP.NET connecting to SQL Server using unknown user ASP.NET IIS更改APP_DATA和Bin文件夹 - ASP.NET IIS change APP_DATA and Bin folders ASP.Net(IIS 7.5)查询没有用户凭据的Active Directory - ASP.Net (IIS 7.5) Querying Active Directory without User Credentials
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM