SQL Server error 18487: Login failed, password expired
The SQL login's password has expired under the server's Windows password policy. Set a new password to let it connect again.
- Error number
18487- Severity
- 14
- Category
- Connection and login
What it means
SQL logins created with CHECK_EXPIRATION = ON follow the server's Windows password expiration policy. When the password is older than the maximum password age, SQL Server rejects the login until a new password is set.
Common causes
- The login was created with
CHECK_EXPIRATION = ONand the password reached the maximum age set in the Windows password policy. - A service account login nobody rotates was given an expiring password.
How to fix it
-
Set a new password as an administrator.
ALTER LOGIN app_user WITH PASSWORD = N'<new strong password>';
-
For a service account whose password you rotate yourself, turn expiration off (password policy still applies).
ALTER LOGIN app_user WITH CHECK_EXPIRATION = OFF;
-
See how close other logins are to expiring.
SELECT name, LOGINPROPERTY(name, 'DaysUntilExpiration') AS days_left FROM sys.sql_logins WHERE is_expiration_checked = 1;
Related errors
18488Login failed, password must be changed18456Login failed for user18486Login failed, account locked outORA-28001Oracle: the password has expired
More connection and login errors
53Network-related or instance-specific4060Cannot open database requested4064Cannot open user default database18452Login is from an untrusted domain18470Login failed, account disabled18461Login failed, single user mode
The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.
Work on SQL Server in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.