DBAtlas · Database operations atlas

18456: Login failed for user

SQL Server

What 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.

Open in DBAtlas →

More from this engine