SQL Server engine errors
SQL Server 18456 Login Failed
Reviewed for reference consistency: April 11, 2026
Login Failed — the user login attempt failed
What 18456 Means
The 18456 error on the SQL Server engine errors indicates login failed — the user login attempt failed. This typically occurs due to incorrect username or password provided.
Error 18456 is a generic security error. SQL Server purposely provides limited information in the error message to prevent attackers from discovering which part of the credentials was incorrect.
How to fix 18456
General informational guidance, not professional advice. Commands can affect your system or data — back up first and proceed at your own risk. FixerCode is an independent reference, not affiliated with any vendor mentioned.
Read the State code in the error log
The public message is vague, but the error log records a State number that names the real cause (State 5 unknown login, 7 disabled, 38 no database access).
EXEC xp_readerrorlog 0, 1, N'Login failed';Confirm the login exists and is enabled
Check that the SQL login is present and not disabled before assuming the password is wrong.
SELECT name, is_disabled FROM sys.sql_logins WHERE name = 'youruser';Verify the server allows SQL logins
SQL authentication fails entirely when the instance runs in Windows-only mode. A result of 0 means mixed mode is enabled.
SELECT SERVERPROPERTY('IsIntegratedSecurityOnly');Reset the password if it is wrong or expired
Set a fresh strong password for the login, then update the application connection string to match.
High-impact command - back up first and proceed carefully.
ALTER LOGIN [youruser] WITH PASSWORD = 'NewStrongP@ssw0rd';
Technical Background
The login process in SQL Server involves two main steps: authentication (verifying who you are) and authorization (checking what you are allowed to do). Error 18456 happens during the authentication step, meaning the server couldn't verify the identity provided.
For security reasons, the public error message is always vague. Administrators can find the specific reason (like 'password expired' or 'invalid password') by checking the SQL Server Error Log on the server machine.
Common Causes
- Incorrect username or password provided
- Login disabled by an administrator
- Account locked out due to too many failed attempts
Typical Scenarios
- An application service account has an expired password
- A developer uses the wrong connection string credentials
What to Know
Verifying credentials and account status is the standard response to authentication failures. For administrators, the SQL Server Error Log contains specific 'State' codes that reveal the exact cause of the login rejection.
Frequently Asked Questions
Common questions about SQL Server 18456 error
This is a security feature to prevent brute-force attacks from identifying valid usernames.