Subscribe

Solve login failed error for IIS APPPOOL\DefaultAppPool

I recently ran into the classic SQL Server connection error message "Login failed". This, of course, nearly always has to do with insufficient rights to the database.

However, I also got this error message:

Login failed for user 'IIS APPPOOL\DefaultAppPool

In this case, I tried to anonymously connect to a SQL Server Database (in Windows 7, mind).

This is how to solve the problem:

  1. In Internet Information Services, right click the website that tries to connect to the database->choose Manage Web Site -> Advanced Settings. Take a look at the Application Pool used, in this case DefaultAppPool:
    IIS Application Pool settings
  2. Now that you know the application pool the website uses, instead right click Application Pools (in IIS root) -> right click the correct application pool -> choose Advanced Settings.
  3. Under Advanced Settings, find Identity and choose LocalService as the Built-in account:
    Change Application Pool Identity to LocalService
  4. Done!

Comments

thank you very much you help me a lot

Very helpful post, thanks.

that helped me.

Just installed Visual Studio on Windows 7 box

Perfect Solution

From point of security reasons is better to add IIS APPPOOL\DefaultAppPool as owner of your db. For example, just run the next command in the Query window of selected db:
sp_addrolemember 'db_owner','IIS APPPOOL\DefaultAppPool'

Write a comment





Or use Twitter to identify


To the top