Login failed for user (Error 18456)

Common SQL Errors

Authentication
Sign up for the latest in common SQL errors from the Galaxy Team!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
SQL Server error 18456 indicates a failed login attempt due to invalid credentials or authentication issues.
SQL Server
Login failed for user '<user_name>'. (Microsoft SQL Server, Error: 18456)

Explanation

Error 18456 occurs when a login attempt to SQL Server fails. This error is triggered by authentication issues such as incorrect usernames or passwords, disabled accounts, or mismatches between the authentication mode and the login credentials. SQL Server does not reveal the exact reason for the failure in the error message returned to the client to avoid security risks. Instead, a corresponding error state code provides more specific detail in the SQL Server error logs.

Each state code gives insight into why the login failed:

  • State 1: Error information is not available (generic).
  • State 8: Password is incorrect.
  • State 11/12: Login is valid, but server access is denied.
  • State 18: Password must be changed.

Admins should review the SQL Server logs to find the specific state number and use that to diagnose the issue further.

Common Causes

  • Incorrect login credentials (username or password)
  • SQL Server login not mapped to a user in the database
  • SQL Server in Windows Authentication mode, but SQL login used
  • Account is disabled, locked out, or not granted access
  • Password needs to be changed (State 18)
  • Related Errors

  • Error 4064: Cannot open user default database
  • Error 18452: Login failed. The user is not associated with a trusted SQL Server connection.
  • FAQs

    Q: Why don’t I see the reason for the login failure in the client error?
    A: SQL Server deliberately hides detailed reasons for login failures to prevent attackers from gathering information.

    Q: Where can I find the exact reason for error 18456?
    A: Check the SQL Server error logs. The state code (e.g. 8, 11, 18) gives more specific context.

    Trusted by top engineers on high-velocity teams

    Aryeo Logo
    Assort Health
    Curri
    Rubie
    Comulate
    Truvideo Logo