Login failed for user 'IIS APPPOOL\ASP.NET v4.0'

本文介绍了当遇到SQL Server登录失败错误时的解决方案,特别是针对IIS应用池身份(如IISAPPPOOLASP.NETv4.0)的权限配置问题。文章提供了详细的步骤来创建新的SQL Server登录并授予数据库权限。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Looks like it's failing trying to open a connection to SQL Server.

You need to add a login to SQL Server for IIS APPPOOL\ASP.NET v4.0 and grant permissions to the database.

In SSMS, under the server, expand Security, then right click Logins and select "New Login...".

In the New Login dialog, enter the app pool as the login name and click "OK".

 

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'

Login failed for user IIS APPPOOL\DefaultAppPool

 

 

Thanks jobran456 for reply, but this thread suggests not to use NetworkService in IIS 7+ due to security considerations. Instead it is recommended to use ApplicationPoolIdentity as default Identity setting. This is by default in IIS 7 and later but you need also check for the followings (summarized from this thread):

  • Set Read permission for IIS_IUSRS on the the web application's local directory. IIS_IUSRS is used when Anonymous Authentication is enabled.
  • Create a new SQL Login (user) as "IIS APPPOOL\DefaultAppPool" and give it db_owner role membership.
  • it's not a real windows account, you can't user the "Search" button.  Just enter the account name 'IIS APPPOOL\DefaultAppPool', set your security settings, and click OK.

转载于:https://www.cnblogs.com/itelite/p/4282566.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值