18456 SQL Origin: Data OSI layer 7 · Application Last updated 11 Oct 2026

SQL Server: Login failed for user 'x'. (Error 18456)

SQL Server rejected the login — wrong password, wrong authentication mode, or a disabled/missing login.

Exact message you may see Login failed for userError: 18456
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

  1. Check the State in the SQL Server error log
  2. Enable mixed mode authentication and restart
  3. Map the login to a database user / fix the default database

Detailed fix by platform

SQL

  1. ALTER LOGIN app WITH PASSWORD = 'NewStrongPass!1', CHECK_POLICY = ON;

How to diagnose

  1. State — Which state in the error log?
  2. 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:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

1045 — MySQL ERROR 1045 (28000): Access denied for user (MySQL)104515281 — SQL Server Msg 15281: SQL Server blocked access to procedure 'sys.xp_cmdshell' (component 'xp_cmdshell' turned off) (SQL)152811698 — MySQL ERROR 1698 (28000): Access denied for user 'root'@'localhost' (MySQL)169818452 — SQL Server Error 18452: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication (SQL)18452229 — SQL Server Msg 229: The SELECT permission was denied on the object (SQL)229245 — SQL Server: Conversion failed when converting the varchar value 'x' to data type int. (Msg 245) (SQL)24528P01 — PostgreSQL: FATAL: password authentication failed for user (PostgreSQL)28P014060 — SQL Server Error 4060: Cannot open database requested by the login. The login failed (SQL)406018456

Explore the map of this error Full error map →

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