()


Solution for MySql – ERROR 1819 (HY000): Your password does not satisfy the current policy requirements


When you install Mysql Server using YUM Repository method Click here to read more then Validate Password component will be installed and enabled by default but if you had installed Mysql Server using Binaries Tar method Click here to read more then Validate Password component need to install manually. In this article we will demonstrate a solution for MySql – ERROR 1819 (HY000): Your password does not satisfy the current policy requirements.


If the Validate Password component is enabled you will receive the below error while creating a mysql user with a weak password. You will keep getting this error until the password meets the minimum requirements of the current password policy or you may disable the Validate Password component.

mysql@inst1>create user 'test1'@'localhost' identified by 'Test123';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql@inst1>


You can see the Validate Password component with the below command. There are three levels of password validation policy enforced when Validate Password is enabled:

 

  • LOW Length >= 8 characters.
  • MEDIUM Length >= 8, numeric, mixed case, and special characters.
  • STRONG Length >= 8, numeric, mixed case, special characters, and dictionary file.
mysql@inst1>show variables like '%validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password.check_user_name    | ON     |
| validate_password.dictionary_file    |        |
| validate_password.length             | 8      |
| validate_password.mixed_case_count   | 1      |
| validate_password.number_count       | 1      |
| validate_password.policy             | MEDIUM |
| validate_password.special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.01 sec)


As you can see above, the currently enforced password level is Medium. So our password should be 8  characters long with a number, mixed case, and special characters. I am going to set this password – Test1234!% using the command:

mysql@inst1> create user 'test1'@'localhost' identified by 'Test1234!%';
Query OK, 0 rows affected (0.00 sec)

mysql@inst1>


You can also solve the “ERROR 1819 (HY000)…” by setting up a lower level password policy. For the LOW password level, you need to have 8 characters. If you try to use a password less than 8 Characters you will receive the below error.

mysql@inst1>SET GLOBAL validate_password.policy=LOW;
Query OK, 0 rows affected (0.00 sec)

mysql@inst1>show variables like '%validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password.check_user_name    | ON    |
| validate_password.dictionary_file    |       |
| validate_password.length             | 8     |
| validate_password.mixed_case_count   | 1     |
| validate_password.number_count       | 1     |
| validate_password.policy             | LOW   |
| validate_password.special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0.00 sec)

mysql@inst1>create user 'test2'@'localhost' identified by 'Test123';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements


mysql@inst1>create user 'test3'@'localhost' identified by 'Test1234';
Query OK, 0 rows affected (0.00 sec)

mysql@inst1>


Now let see how to Disable the password validation policy. Execute the below command to temporarily disable. Now you can create a user with a password containing any number of characters as you required.

mysql@inst1>UNINSTALL COMPONENT "file://component_validate_password";
Query OK, 0 rows affected (0.00 sec)

mysql@inst1>show variables like '%validate_password%';
Empty set (0.01 sec)
mysql@inst1>

mysql@inst1>create user 'test4'@'localhost' identified by 'test';
Query OK, 0 rows affected (0.00 sec)


Use the below command to enable Password Policy once you set the password.

mysql@inst1>INSTALL COMPONENT "file://component_validate_password";
Query OK, 0 rows affected (0.00 sec)

mysql@inst1>
mysql@inst1>show variables like '%validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password.check_user_name    | ON     |
| validate_password.dictionary_file    |        |
| validate_password.length             | 8      |
| validate_password.mixed_case_count   | 1      |
| validate_password.number_count       | 1      |
| validate_password.policy             | MEDIUM |
| validate_password.special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.00 sec)

mysql@inst1>


This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.


Hope so you like this article
!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our mission.

Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Jamsher Khan

Hello and welcome to DBsGuru,I’m Jamsher Khan working as Senior Oracle DBA based in KSA-Jeddah, I have working experience in Oracle DBA, SQL Server, MySql, PostgreSQL, Linux, Golden Gate, ODA.Thanks for the visits!Share Learn Grow!