MySQL. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Since installing fresh MySQL on my MacBook I tried to create a new database user and a new database couple of times. On local I usually use rather weak passwords, but when I was trying to set a weak password, I was getting an error: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements.

I googled this error some time ago and somehow I was OK with the results I’ve found:

  • password has to be 8 symbols long,
  • password should have at least one special symbol and one number.

Apparently that happens because of a plugin called validate_password.

You can view validate_password properties: SHOW VARIABLES LIKE ‘validate_password%’.

+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| 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,02 sec)

From the table above we see that ‘validate_password_policy’ is set to ‘MEDIUM’ (1). Other possible values are ‘LOW’ (0) or ‘STRONG’ (2).

We can set it to ‘LOW': SET GLOBAL validate_password_policy = ‘LOW’.

‘validate_password_length’ = 8. This sets password length. It can’t be less than 2 × validate_password_mixed_case_count + validate_password_number_count + validate_password_special_char_count. Let’s leave it 8.

‘validate_password_mixed_case_count’ = 1 means that password should have at least one UPPERCASE and one lowercase letter. This property only works if ‘validate_password_policy’ variable is ‘MEDIUM’ or ‘STRONG’.

‘validate_password_number_count’ = 1. This is the minimum number of numeric (digit) characters. This works if password policy is ‘MEDIUM’ or stronger.

‘validate_password_special_char_count’ = 1. This is minimum number of nonalphanumeric characters. This works if password policy is ‘MEDIUM’ or stronger.

After setting ‘validate_password_policy’ to ‘LOW’ I was able to create weak passwords on my local MySQL.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>