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

Advertisements

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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s