Error
Error Code:
1819
MariaDB Error 1819: Password Policy Violation
Description
Error 1819 indicates that the password you are attempting to set or change does not meet the security requirements configured on the MariaDB server. This typically occurs during `ALTER USER`, `CREATE USER`, or `SET PASSWORD` operations when the new password fails to satisfy criteria like length, complexity, or uniqueness.
Error Message
Your password does not satisfy the current policy requirements
Known Causes
4 known causesPassword Too Simple
The new password is too short, lacks required character types (e.g., uppercase, numbers, special characters), or contains easily guessable patterns.
Policy Configuration
The MariaDB server's password validation plugin (e.g., `validate_password` or `ed25519`) is configured with strict requirements that the chosen password does not meet.
Similarity to Old Password
The new password is too similar to a previously used password, violating a history or similarity check enforced by the policy.
Contains Prohibited Substrings
The password contains the username, common dictionary words, or other blacklisted substrings specified in the policy.
Solutions
3 solutions available1. Update Password to Meet Policy easy
Change your password to comply with the current MariaDB password policy.
1
Connect to your MariaDB server as a user with privileges to change passwords (e.g., 'root').
mysql -u root -p
2
Identify the current password policy requirements. You can query the `mysql.user` table for the `password_policy` column. A value of 0 means no policy, 1 means strict (requires complexity), 2 means moderate (requires length and at least one digit). Higher numbers indicate stricter policies.
SELECT user, password_policy FROM mysql.user WHERE user = 'your_username';
-- If you don't see the password_policy column, it might be an older version or not explicitly set. You can check server variables for password_require_current_password.
3
Based on the policy, create a new password that meets the requirements (e.g., minimum length, uppercase, lowercase, numbers, special characters).
ALTER USER 'your_username'@'localhost' IDENTIFIED BY 'NewStrongPassword123!';
4
Replace 'your_username' with the actual username and 'NewStrongPassword123!' with your new, compliant password. Log out and try connecting with the new password.
exit
2. Temporarily Disable Password Policy medium
Lower the password policy requirements to allow for easier password changes.
1
Connect to your MariaDB server as a user with administrative privileges (e.g., 'root').
mysql -u root -p
2
Check the current password policy settings. The relevant server variable is `password_policy`.
SHOW VARIABLES LIKE 'password_policy';
3
To disable strict password checking (effectively setting policy to 0 or a less strict level), you can set the `password_policy` variable. For a quick, temporary change, use `SET GLOBAL`. For a permanent change, edit the MariaDB configuration file.
-- Temporary change (resets on server restart):
SET GLOBAL password_policy = 0;
-- Permanent change (requires editing my.cnf or mariadb.conf.d/50-server.cnf):
-- Add or modify the following line under the [mysqld] section:
-- password_policy = 0
4
After changing the policy, you can update the user's password to something simpler, then re-enable the policy if desired.
ALTER USER 'your_username'@'localhost' IDENTIFIED BY 'SimplePassword';
-- To re-enable a moderate policy (requires length and at least one digit):
-- SET GLOBAL password_policy = 2;
5
If you modified the configuration file, restart the MariaDB service for the changes to take effect.
# For systemd-based systems:
sudo systemctl restart mariadb
# For older init.d systems:
sudo service mariadb restart
3. Reset Password for a User medium
If you've forgotten the password or can't meet the policy, reset it to a known value.
1
Connect to your MariaDB server as a user with administrative privileges (e.g., 'root').
mysql -u root -p
2
Temporarily disable the password policy to allow setting a simple password. This is often the easiest way to regain access if you're locked out.
SET GLOBAL password_policy = 0;
3
Reset the password for the specific user. Replace 'your_username', 'localhost', and 'NewResetPassword' accordingly.
ALTER USER 'your_username'@'localhost' IDENTIFIED BY 'NewResetPassword';
-- If you're unsure of the host, you can use a wildcard or check the user's grants:
-- SELECT user, host FROM mysql.user WHERE user = 'your_username';
4
Exit the MariaDB client.
exit
5
Reconnect to MariaDB using the new password and then update the password policy to your desired level, ensuring the new password complies.
mysql -u your_username -p
-- After connecting and verifying, you can re-apply the desired password policy:
-- SET GLOBAL password_policy = 2; -- Example for moderate policy