18456 🗃️ SQL

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

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