简体   繁体   中英

cannot access sql server after publishing site in iis7

I am created a website using visual studio 2010. On the time of the development of website I am able to access the database.. but after publishing the site using IIS7..i was unable to access the database..the exception occured during that time was "the connection is in the closed state".in IIS7 When I changed the application pool identity to localsystem, it worked. Data base is installed in the same machine. and server is SQL SERVER 2008 R2

发布数据库后,您只能使用sql身份验证访问数据库。

In IIS7 the application pool by default runs under the IIS AppPool\\[Application Pool Name]

That means, if your app pool is called "MyWebSite", then you must give the following user permissions to use your database: IIS AppPool\\MyWebSite

It won't be in any list, so you'll have to type it as above when adding it.

I suggest making it database owner if you're in doubt about which permissions to give it. If it works, you can always refine the permissions later

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