18456: Login failed for user
SQL ServerWhat does it mean?
A login attempt was rejected during authentication. The user name/password may be wrong, the account may be disabled, or the user may have no access to the database.
Why does it happen?
Wrong password, nonexistent login, disabled/locked account, using a SQL login while only Windows authentication is enabled, or no access to the default database. The State code in the error text identifies the real cause (State 5: login does not exist, State 7: login disabled and password also wrong, State 8: wrong password (most common), State 18: password must be changed, State 38: the specified database cannot be opened, State 58: SQL login attempted while the server is in Windows-only authentication mode).
How to fix it
Find the root cause from the State value in the SQL Server error log (details are not sent to the client for security reasons). Verify the user name/password. Check that the server runs in 'SQL Server and Windows Authentication Mode' (mixed mode); if you changed it, restart the service. Verify the login's user mapping and access permission in the target database.
More from this engine
- 2627Violation of PRIMARY KEY / UNIQUE KEY constraint. Cannot insert duplicate key in object
- 2601Cannot insert duplicate key row in object with unique index. The duplicate key value is ...
- 547The INSERT/UPDATE/DELETE statement conflicted with the FOREIGN KEY / CHECK constraint
- 8152String or binary data would be truncated
- 2628String or binary data would be truncated in table, column ...; truncated value
- 1222Lock request time out period exceeded
- 9002The transaction log for database is full due to ...