无法打开数据库“db”登录请求。登录失败。用户'nt authority\\\<br/>etwork service'登录失败。 [英] Cannot open database &quot;db&quot; requested by the login. the login failed. login failed for user &#39;nt authority\network service&#39;.

查看:293
本文介绍了无法打开数据库“db”登录请求。登录失败。用户'nt authority\\\<br/>etwork service'登录失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用visual studio 2010,ms SQLserver 2012,IIS 7.5,我已经在IIS中部署了我的应用程序,当我尝试连接到数据库时,每次我尝试打开与服务器的连接时都会出现以下错误:

I am working with visual studio 2010, ms SQLserver 2012, IIS 7.5,I have deployed my application in IIS and when I am trying to connect to the database the following error appear every time I try to open the connection with the server:

无法打开登录请求的数据库Db。登录失败。

用户'NT AUTHORITY \ NETWORK SERVICE'登录失败。

Cannot open database "Db" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.



请协助

提前致谢



我的尝试:



SQL SERVER - FIX:ERROR:无法打开登录请求的数据库。登录失败。用户&#039; NT AUTHORITYNETWORK SERVICE&#039;登录失败。 - 使用Pinal Dave访问SQL权限 [ ^ ]

推荐答案

这意味着您的代码作为帐户NT AUTHORITY \ NETWORK SERVICE运行。这是因为在IIS中,您的应用程序池的标识设置为NT AUTHORITY \ NETWORK SERVICE,并且您的web.config使用可信连接。



我建议创建一个sql帐户,然后更改您的连接字符串以使用该帐户。或者,您可以按照博客文章的建议进行操作,并授予NT AUTHORITY \ NETWORK SERVICE适当的安全权限。
This means that your code is running as the account NT AUTHORITY\NETWORK SERVICE. This is because in IIS your application pool's identity is set to NT AUTHORITY\NETWORK SERVICE and your web.config is using a trusted connection.

I recommend creating a sql account and then changing your connection string to use that account. Or, you can do as the blog post suggest and grant NT AUTHORITY\NETWORK SERVICE the proper security rights.


这篇关于无法打开数据库“db”登录请求。登录失败。用户'nt authority\\\<br/>etwork service'登录失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆