Change the mysql password security policy

Password policy issue exception information:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Solution:

1. View the initial password policy of mysql and
enter the sentence "SHOW VARIABLES LIKE'validate_password%';" to view it,
as shown in the figure below:
Insert picture description here
2. First, you need to set the password verification strength level, set the global parameter of validate_password_policy to LOW, and
enter the setting Set the value statement "set global validate_password_policy=LOW;"
as shown in the following figure:
Insert picture description here
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 validate_password_length. The global parameter is 6 and
enter the setting statement "set global validate_password_length=6;" to set the value,
as shown in the figure below:
Insert picture description here
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, which consists of one uppercase/lowercase letter + one Arabic numeral + one special character.
As long as the length of the 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 upper/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 password strength verification level, the default is MEDIUM;
about the value of validate_password_policy:
0/LOW: only verify length;
1/MEDIUM: verify length, number , Uppercase and lowercase, special characters;
2/STRONG: verify length, numbers, uppercase and lowercase, special characters, dictionary files;
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/Fengfgg/article/details/113556735