<p>MySQL raises Error 1820 when an account is forced to change its password before any statement can run.</p>
<p>MySQL Error 1820 ER_MUST_CHANGE_PASSWORD signals that the current account must reset its password before executing queries. Connect as the user or an administrator and run ALTER USER IDENTIFIED BY 'NewStrongPass!'; to clear the expired flag and restore access.</p>
You must reset your password using ALTER USER statement
MySQL throws Error 1820 with the condition name ER_MUST_CHANGE_PASSWORD when an account is flagged to change its password before executing any statement.
This security safeguard appears immediately after a DBA creates a user with the PASSWORD EXPIRE option or when a scheduled password expiration policy triggers.
The error surfaces during the first login attempt or any subsequent query executed by the affected account until the password is reset.
Applications that reuse pooled connections will also fail until the password change is completed.
Leaving the account in an expired state blocks all data access, interrupts services, and can hide deeper authentication policy issues.
Promptly resetting the password restores availability and keeps you compliant with security rules.
The immediate cause is the ACCOUNT has_password_expired flag set to Y in mysql.user.
This flag can be set by password expiration policies, manual DBA action, or MySQL upgrade scripts that detect weak defaults.
Login as the affected user or a privileged administrator and run ALTER USER user IDENTIFIED BY 'NewStrongP@ss1';
This statement resets the password, clears the expired flag, and allows the session to proceed normally.
If the application uses a service account, deploy an automated script that updates the credential in both MySQL and your secrets manager.
For multiple expired accounts, loop through mysql.user where account_locked = 'N' and password_expired = 'Y' and alter each user inside a transaction.
Set a rotation policy that notifies owners before expiration, and use MySQL 8 PASSWORD EXPIRE INTERVAL to stagger resets.
Store all credentials in Galaxy Secrets so developers can update them centrally without code changes.
Error 1862 ER_PASSWORD_EXPIRE_ANONYMOUS_USER occurs when an anonymous user must change a password; fix it with the same ALTER USER command.
Error 1822 ER_PASSWORD_EXPIRE_RESERVED_NAME appears when a reserved account hits expiration; rebuild the account with a stronger password.
The DBA might have run CREATE USER ... PASSWORD EXPIRE which forces an immediate password change.
MySQL variable default_password_lifetime forces accounts to expire after N days, triggering Error 1820.
When migrating from older versions, MySQL flags accounts that used obsolete hashing methods as expired.
Someone may have updated the mysql.user table and set password_expired to Y.
Raised when the anonymous account must change its password. Reset or drop the anonymous user.
Occurs when a reserved account like mysql.sys is expired. Use ALTER USER or skip name remapping.
General authentication failure, often seen after error 1820 if the password was changed incorrectly.
Indicates the user is in grace period before forced expiration; change the password to avoid hitting error 1820.
No. In MySQL 8 the ALTER USER privilege is sufficient, which is granted automatically to accounts that can change their own password.
Yes. Set default_password_lifetime = 0 in my.cnf and restart, but evaluate security compliance before disabling.
Query mysql.user where password_expired = 'Y'. Monitor this in Galaxy with a saved query.
If the replication user is expired, update its credential in both master and replica configuration files after running ALTER USER.