"Login failed for user" error message when you log on to SQL Server

Article translations Article translations
Article ID: 555332 - View products that this article applies to.
Author: Yuval Sinay MVP
COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.
Expand all | Collapse all

Symptoms

After you install Microsoft SQL Server 2012, SQL Server 2008, SQL Server 2005, or SQL Server 2000 and you try to connect to the server that is running SQL Server, you receive one of the following error messages: 
  • Login failed for user '%.*ls'. The login is a SQL Server login and cannot be used with Windows Authentication.%.*ls
  • Login failed for user 'username'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

Cause

This problem occurs if the user tries to log in with credentials that cannot be validated. This problem can occur in the following scenarios: 
  • Scenario 1: The login may be a SQL Server login but the server only accepts Windows Authentication.
  • Scenario 2: You are trying to connect by using SQL Server Authentication but the login used does not exist on SQL Server.
  • Scenario 3: The login may use Windows Authentication but the login is an unrecognized Windows principal. An unrecognized Windows principal means that Windows can't verify the login. This might be because the Windows login is from an untrusted domain.

Resolution

To resolve this problem, follow the steps that apply to your scenario.

Scenario 1: Configure SQL Server in Mixed Authentication Mode.

SQL Server 2012, SQL Server 2008, and SQL Server 2005
  1. Open SQL Server Management Studio. To do this, click Start, click All Programs, click Microsoft SQL Server 200x (where x is the version of SQL), and then click SQL Server Management Studio.
  2. Right-click the server, and then click Properties. See image.
  3. On the Security page, under Server authentication, click the SQL Server and Windows Authentication mode option button, and then click OK. See image.
  4. In the SQL Server Management Studio dialog box, click OK to restart SQL Server. 

    For more information, see Choose an authentication mode in SQL Server Books Online.
SQL Server 2000
  1. Open the Enterprise Manager. To do this, click Start, click All Programs, click Microsoft SQL Server 2000, and then click SQL Server Enterprise Manager.
  2. Expand the server group.
  3. Right-click the server, and then click Properties. See image.
  4. Click the Security  tab. See image.
  5. Under Authentication, click the SQL Server and Windows option button.
  6. Restart SQL Server for the change to take effect.

Scenario 2: Verify that the SQL Server login exists

If you are trying to connect to the SQL Server by using SQL Server Authentication, and the server is configured for mixed mode authentication, verify that the SQL Server login exists. For more information, see Create a login in SQL Server Books Online.

Scenario 3: The login may use Windows Authentication but the login is an unrecognized Windows principal.

If you are trying to connect to SQL Server by using Windows Authentication, verify that you are logged in to the correct domain. 

Properties

Article ID: 555332 - Last Review: July 12, 2013 - Revision: 4.1
Applies to
  • Microsoft SQL Server 2012 Standard
  • Microsoft SQL Server 2012 Enterprise
  • Microsoft SQL Server 2012 Developer
  • Microsoft SQL Server 2012 Express
  • Microsoft SQL Server 2012 Web
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2008 Web
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 Enterprise Edition

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com