修改MySQL密码强度验证
密码强度检查等级(默认为1):validate_password_policy
| Policy | Tests Performed |
| —————- | —————————————————————————————— |
| 0 or LOW | Length |
| 1 or MEDIUM | Length; numeric, lowercase/uppercase, and special characters |
| 2 or STRONG | Length; numeric, lowercase/uppercase, and special characters; dictionary file |密码至少要包含的小写字母个数和大写字母个数:validate_password_mixed_case_count
mysql> set global validate_password_mixed_case_count=0; Query OK, 0 rows affected (0.00 sec)密码至少要包含的数字个数:validate_password_number_count
mysql> set global validate_password_number_count=0; Query OK, 0 rows affected (0.00 sec)密码至少要包含的特殊字符的个数:validate_password_special_char_count
mysql> set global validate_password_special_char_count=0; Query OK, 0 rows affected (0.00 sec)密码最小长度(默认为8):validate_password_length
它的最小值限制为:validate_password_number_count + validate_password_special_char_count + (2 * validate_password_mixed_case_count)
mysql> set global validate_password_length=0; Query OK, 0 rows affected (0.00 sec)用于验证密码强度的字典文件路径:validate_password_dictionary_file
查看MySQL全局参数配置:
SHOW VARIABLES LIKE 'validate_password%';
mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 0 |
| validate_password_mixed_case_count | 0 |
| validate_password_number_count | 0 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 0 |
+--------------------------------------+-------+
7 rows in set (0.01 sec)