Change password rules for versions earlier than MySQL 8.x

View password related variables:

mysql> show variables like 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| 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      |
+--------------------------------------+--------+
6 rows in set (0.00 sec)

Explanation of variable meaning:
validate_password_dictionary_file: the path of the dictionary file used to verify the strength of the password;
validate_password_length: the minimum length of the password, the parameter defaults to 8, which has a minimum limit;
validate_password_mixed_case_count: the number of uppercase and lowercase letters that the password must contain at least;
validate_password_number_count: The number of digits that the password must contain at least;
validate_password_policy: Password strength level check, the default is 1. 0 (LOW): only check the length; 1 (MEDIUM): check the length, case and special characters; 2 (STRONG) ): Check length, case, special characters and dictionary_file.
validate_password_special_char_count: The minimum number of special characters that the password must contain.

mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_mixed_case_count=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_number_count=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_special_char_count=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set global validate_password_length=3;
Query OK, 0 rows affected (0.00 sec)

1. The strength level of the modified password is 0, which is LOW;
2. The number of uppercase and lowercase letters to
be included in the modified password is at least 0; 3. The number of numbers to be included in the modified password is at least 0;
4. To modify the password The minimum number of special characters to be included is 0;
5. The minimum length of the modified password is 3;

If you want loose password rules, you only need to change the password strength level to 0 and change the minimum number of password lengths.

Guess you like

Origin blog.csdn.net/liaowenxiong/article/details/123346222