SQL Server: Login failed for user 'x'. (Error 18456)
SQL Server rejected the login — wrong password, wrong authentication mode, or a disabled/missing login.
Login failed for userError: 18456 Meaning
The server error log has a State number that explains the reason (e.g. 8 wrong password, 5 invalid user, 38 database not accessible, 58 SQL auth disabled).
Common causes
- Wrong password
- SQL Server in Windows-only authentication mode
- Login has no access to the default database
- Login disabled or locked
⚡ Quick fix
- Check the State in the SQL Server error log
- Enable mixed mode authentication and restart
- Map the login to a database user / fix the default database
Detailed fix by platform
SQL
ALTER LOGIN app WITH PASSWORD = 'NewStrongPass!1', CHECK_POLICY = ON;
How to diagnose
- State — Which state in the error log?
- Auth mode — Mixed enabled?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in SQL
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 11 Oct 2026