SQL Server: Login failed for user 'x'. (Error 18456)
SQL Server rejected the login — wrong password, wrong authentication mode, or a disabled/missing login.
Seen on:
SQL
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 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026