Sunday, May 20, 2012
Blog Entries

Dealing with the ASP.NET "Login failed for user <MachineName>\<User>'" error

Nov 29

Written by:
11/29/2007 3:53 PM  RssIcon

If you are reinstalling Microsoft SQL Server 2005 Express on a server running ASP.NET and Plesk, when you try to view an ASP.NET web page, you might see a message like the following:

Cannot open database "TellUWhen" requested by the login. The login failed.
Login failed for user 'MIGHTYMOUSE\IWAM_plesk(default)'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Syste.Data.SqlClient.SqlException: Cannot open database "TellUWhen" requested by the login. The login failed. Login failed for user 'MIGHTYMOUSE\IWAM_plesk(default)'.

The basic solution to the problem is to make sure that the specified user name (e.g. ASPNET or IWAM_plesk(default)) is a member of the SQLServer2005MSSQLUser$server$SQLExpress group.

Here are the specific steps to do this for the user "<User>" on "<MachineName>":

  1. Right-click "My Computer" and choose "Manage".
  2. Navigate to "Local Users and Groups\Users\<User>".
  3. Right-click on and select Properties.
  4. Select the "Member Of" tab.
  5. Click on Add > Advanced > Find Now.
  6. Select SQLServer2005MSSQLUser$<MachineName>$SQLExpress. Click on OK and OK to add this user to this group.
  7. Close the Computer Management window and restart IIS (or reboot the computer).
  8. Revisit the problem web page. It should work now.

Tags:
Categories:
Location: Blogs Parent Separator Blogs
Search Blog
Privacy Statement  |  Terms Of Use
Copyright 2007-2011 by Larry Daniele