Login failed for user ‘IIS APPPOOL\DefaultAppPool’.


Recently I faced an issue while database connectivity(SQL Server 2008 R2) on my Windows 7 machine for a web app.

Cannot open database "Database Name" requested by the login. The login failed.
Login failed for user ‘IIS APPPOOL\DefaultAppPool’.

This issue was related to security.

I could resolve the issue by creating a login for user IIS APPPOOL\DefaultAppPool and giving same user permission to respective database.

Steps-

First of all Login needs to be created for the user “IIS APPPOOL\DefaultAppPool” in SQL Server.

Expand Security –> Right Click on Logins –> Click New Login…

image

Enter login name as “IIS APPPOOL\DefaultAppPool” and Click OK.

image

To give the permission to the database

Right Click on the Database –> Properties

image

Select Permissions –> Click on Search

image

Click Browse then Select “IIS APPPOOL\DefaultAppPool” user –> click OK –> click OK –> click OK

image

That’s it Smile

 

Thanks

MSCoder

One thought on “Login failed for user ‘IIS APPPOOL\DefaultAppPool’.

  1. Awesome man!!!!!!!!!!!!!.Thanks a lot i spent a week looking for the solution to this error.
    Thanku so much…………

Leave a comment