VirtualObjectives

Understanding "login failed" (Error 18456) error messages

If the server encounters an error that prevents a login from succeeding, the client will display the following error message.

Msg 18456, Level 14, State 1, Server <server name>, Line 1
Login failed for user '<user name>'
Note that the message is kept fairly nondescript to prevent information disclosure to unauthenticated clients. In particular, the 'State' will always be shown to be '1' regardless of the nature of the problem. To determine the true reason for the failure, the administrator can look in the server's error log where a corresponding entry will be written. An example of an entry is:
2010-02-17 00:03:00.31 Logon Error: 18456, Severity: 14, State: 8. 
2010-02-17 00:03:00.31 Logon Login failed for user '<user name>'. [CLIENT: <ip address>]
The key to the message is the 'State' which the server will accurately set to reflect the source of the problem. In the example above, State 8 indicates that the authentication failed because the user provided an incorrect password. The common error states and their descriptions are provided in the following table:

ERROR STATE
ERROR DESCRIPTION
2 and 5
Invalid userid
6
Attempt to use a Windows login name with SQL Authentication
7
Login disabled and password mismatch
8
Password mismatch
9
Invalid password
11 and 12
Valid login but server access failure
13
SQL Server service paused
18
Change password required

Other error states indicate an internal error and may require assistance from Microsoft.