mysql: 重置密码时报:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

一,重置密码时的报错信息

mysql> alter user root@localhost identified by 'mypassword';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql>  alter user root@localhost identified by 'mypassword2';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> 

 

二,问题原因:

因为你设置的密码没有满足系统当前的密码安全策略要求。

那么当前的安全策略是什么呢?

SHOW VARIABLES LIKE 'validate_password%';
mysql> SHOW VARIABLES LIKE 'validate_password%';
+-------------------------------------------------+--------+
| Variable_name                                   | Value  |
+-------------------------------------------------+--------+
| validate_password.changed_characters_percentage | 0      |
| validate_password.check_user_name               | ON     |
| 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      |
+-------------------------------------------------+--------+
8 rows in set (0.02 sec)

说明:

validate_password.length:密码最小长度
validate_password.mixed_case_count:要求的大小写字母数量
validate_password.number_count:要求的数字字符数量
validate_password.policy:密码强度策略(LOW, MEDIUM, STRONG)

三,设计的密码需要满足什么规则?

长度:密码长度足够(例如,至少 8 个字符)。

复杂度:包含大小写字母、数字和特殊字符。

 

posted @ 2025-02-15 11:12  刘宏缔的架构森林  阅读(335)  评论(0)    收藏  举报