Error 18456 means SQL Server rejected the connection because the supplied login could not be validated.
SQL Server Error 18456 occurs when the server rejects a login attempt. Check the State code in the error log to pinpoint the cause—most often wrong password, disabled account, or missing permissions—then correct credentials or grant access to resolve.
Login failed for user '<user>'. (Microsoft SQL Server, Error: 18456)
The most common trigger is an incorrect password or mismatched authentication mode. SQL Server checks the credentials against Windows or SQL logins and returns Error 18456 if validation fails.Other causes include disabled or locked accounts, expired passwords, missing database access, orphaned users after restores, and service accounts without the CONNECT permission.
Start by reviewing the error log. The State code narrows the problem: 1 = wrong password, 2 = user not allowed, 5 = account disabled, 6 = password expired, 7 = login disabled, 8 = password mismatch, 11/12 = database unreachable.Use T-SQL or SSMS to correct permissions, enable the account, reset the password, or map the login to the target database. Re-test the connection after each change.
Application pool identity fails after password change—reset the credential and recycle the pool.Restored database rejects logins—run sp_change_users_login or ALTER USER ... WITH LOGIN to link users to logins.Mixed authentication disabled—switch to SQL + Windows mode in server properties or convert the connection string.
Enforce strong password policies and rotate secrets with a vault. Monitor the error logs for repeated 18456 events and alert the DBA team.Use contained databases or Azure AD authentication to reduce orphaned logins. Store connection strings securely and automate deployment with CI/CD secrets.
Error 233 indicates the server dropped the connection after Error 18456; fix the login first. Error 4064 points to an unavailable default database—set a valid default or change it in the connection string.Error 18451 surfaces when the login is valid but the user is not associated with a trusted SQL Server connection; re-map the login or enable contained authentication.
Incorrect password or username supplied in the connection string.
SQL login disabled, locked, or password expired.
Windows account removed from Active Directory or relevant group.
Server set to Windows-only authentication but client forces SQL login.
Default database offline, unavailable, or the login lacks access.
Orphaned user after database restore or migration.
• Error 233 – No process is on the other end of the pipe after failed login.• Error 18451 – Login is not associated with a trusted SQL Server connection.• Error 4064 – Cannot open user default database.• Error 4062 – Login failed while opening a database that does not exist.
State 1 is a generic code shown to the client. Check the SQL Server error log for the real State value that pinpoints the exact cause.
Open the error log in SSMS or run xp_readerrorlog. Search for 18456 entries; the State column appears after the error number.
Mixed Mode allows both Windows and SQL logins. It solves errors caused by Windows-only mode but not issues like wrong passwords or disabled accounts.
Galaxy’s AI copilot audits connection strings, flags mismatched authentication modes, and suggests T-SQL fixes directly in the editor, reducing 18456 incidents.