mysql modify user password error

mysql modify password error

Your password does not satisfy the current policy requirements

This is when mysql is initialized, a temporary password is used, and when the custom password is modified, because the custom password is relatively simple, there is a problem that it does not comply with the password policy.

Password policy problem exception information:

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

Solution:

  • 1. View the initial password policy of mysql,

Enter the statement SHOW VARIABLES LIKE 'validate_password%'; to view

mysql> 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.00 sec)
  • 2. First, you need to set the verification strength level of the password, and set the global parameter of validate_password_policy to LOW.

Enter the setting statement set global validate_password_policy=LOW; to set the value,

  • 3. The current password length is 8. If you don’t mind, you don’t need to modify it. Generally speaking, set it to a 6-digit password, and set the global parameter of validate_password_length to 6.

Enter the setting statement set global validate_password_length=6; to set the value,

  • 4. Now you can set a simple password for mysql, as long as it meets the length of six digits,

Enter the modification statement ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; You can see that the modification is successful, indicating that the password policy modification is successful! ! !

Note: The minimum length of the default password is 4, consisting of one uppercase/lowercase letter + one Arabic numeral + one special character,

As long as the length of the set password is less than 3, it will be automatically set to 4,

About mysql password policy related parameters;

  • 1. validate_password_length The total length of the fixed password;

  • 2. validate_password_dictionary_file specifies the file path for password verification;

  • 3. validate_password_mixed_case_count The entire password must contain at least the total number of uppercase/lowercase letters;

  • 4. validate_password_number_count The entire password must contain at least the number of Arabic numerals;

  • 5. validate_password_policy specifies the strength verification level of the password, and the default is MEDIUM;

Regarding the value of validate_password_policy:

0/LOW:只验证长度;

1/MEDIUM:验证长度、数字、大小写、特殊字符;

2/STRONG:验证长度、数字、大小写、特殊字符、字典文件;
  • 6. validate_password_special_char_count The entire password must contain at least the number of special characters;

Guess you like

Origin blog.csdn.net/cljdsc/article/details/129530055