How To Resolve Error 1819 (HY000): Your Password Does Not Satisfy The Current Policy Requirements

Not to worry about this error, you can simply follow the policy or else change the policy.

When changing your password or creating a new database user in MySQL, you will find the error 1819 (HY000): Your password does not satisfy the current policy requirements.

I think from the error message you are able to understand that there is some issue that restricts you from setting a password for your MySQL account.

As far as I know, I have not setup any policies for passwords, so how could it be implemented on MySQL?

This thing happened when you ran mysql_secure_installation to secure mysql by removing anonymous users, tables, and disallowing remotely root access, which also asked you to implement a password policy.

And the chances are high that you selected the STRONG policy, which restricts you from using weak passwords and requires a combination of upper- and lower-case letters, numbers, and special characters. 

If you want, you can remove the password validation component so it won’t bother you while setting up weak passwords for MySQL, or else you can use the different policy, which is available out of the box in MySQL.

So let me show you how you can configure the password validation policy in MySQL. 

Steps to Configure Password Validation Policy in MySQL

The steps are simple; you just need to login to your MySQL instance and run the command, which I’ll share with you, to lower the policy.

Do note that using a weak password can make your MySQL server vulnerable to many security issues, so don’t make this change to your production server.

Step 01View Current Policy

The first and foremost step is to log into your MySQL server and run the following command to show the current password validation policy.

mysql> SHOW VARIABLES LIKE 'validate_password%';

As you can see, the validate_password.policy value is “STRONG”, which indicates that the password policy is set to require a strong password.

Show Password validation level in mysql
Show Password Validation Level in MySQL

Now move to the next section to change the current password policy.

Step 2Change Password Policy

The MySQL Password Validation Component has three different policies, such as the following:

  • validate_password.policy=LOW: It accept any 8 character long password. If you want, you can change the length by making changes to validate_password.length.
  • validate_password.policy=MEDIUM: Your passwords must contain at least 1 numeric character, 1 lowercase character, 1 uppercase character, and 1 special (non-alphanumeric) character.
  • validate_password.policy=STRONG: It is similar to the medium policy, but it has the advantage of referring to the dictionary file to check if the consective substring of length 4 or more should not be matched in dictionary file.

After reading the above explanation, you will be aware of the policy. If you want to continue to follow the policy, then you can stop reading the guide and follow the policy rule.

But if you want to change the policy to “LOW” for allowing weak passwords to be set for certain reasons, then run the following query to the MySQL console.

mysql> SET GLOBAL validate_password.policy=LOW;

Result of the above command with the changes.

Set password policy level to low
Set password policy level to low

Once you are done with the changes, you can now use any character or simple password, but it should be at least eight characters long.

If you don’t want that long, then you can change it by executing the following query:

mysql> SET GLOBAL validate_password.length=4;

Once it’s done, you can verify the policy again by executing SHOW VARIABLES LIKE 'validate_password%';

Step 3Run Command

After running the above query, you can try to create or add a new user with a new policy.

For instance, let me change the MySQL password to something very simple and handy.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '1234';

Now you should not get the “Your password does not satisfy the current policy requirements error on your MySQL”. If it’s again showing the same error, then I would advise you to retry the steps.

If issue still persist, then let us know in the comment section.

Leave a Reply