Question

I made the following settings on my SQL Server 2012 as suggested in many tutorials:

  • I set the server authentication to "SQL Server and Windows Authentication mode"
  • I set a strong password with enforced password policy with default database "master" to SA user
  • I granted the SA user permission to connect to database engine and enabled his login.

Yet when I try to login to the "localhost" through the SQL Server Authentication.

it fails with:

Cannot connect to (local).
------------------------------
Login failed for user 'sa'. (Microsoft SQL Server, Error: 18456)

Only possible way how can I login is still the Window authentication.

My instance is named MSSQLSERVER. localhost\MSSQLSERVER is inaccessible.

Was it helpful?

Solution

There could be multiple reasons. Please check your error log and find the state of error. Depending upon the state, error could be -

State Description
1     Error information is not available. This state usually means you do not have permission to receive the error details. Contact your SQL Server administrator for more information.
2     User ID is not valid.
5     User ID is not valid.
6     An attempt was made to use a Windows login name with SQL Server Authentication.
7     Login is disabled, and the password is incorrect.
8     The password is incorrect.
9     Password is not valid.
11    Login is valid, but server access failed. One possible cause of this error is when the Windows user has access to SQL Server as a member of the local administrators group, but Windows is not providing administrator credentials. To connect, start the connecting program using the Run as administrator option, and then add the Windows user to SQL Server as a specific login.
12    Login is valid login, but server access failed.
18    Password must be changed.

For detailed information - MSDN

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top