使用以下语句尝试修改 root 密码时, mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘MyNewPass‘;
如果提示如下错误: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
那是因为新密码不满足安全性要求,可查看目前的密码要求: mysql> show variables like ‘validate_password%‘
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| 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 |
+--------------------------------------+--------+
7 rows in set (0.04 sec)
根据上述规则重新设置密码。 也可以修改该规则以满足需要,比如: SET GLOBAL validate_password_length = 4;
SET GLOBAL validate_password_number_count = 0;
再次检查规则: mysql> show variables like ‘validate_password%‘;
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 4 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 0 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.00 sec)
最后,也可以通过关闭密码检查的插件来达到设置任意密码的目的, mysql>uninstall plugin validate_password;
但不建议这么做,或者说改好密码后再重新将插件装回来。 相关资源 |
The text was updated successfully, but these errors were encountered: |
相关文章
- 07-11SpringSecurity 退出登录/修改密码/重置密码 使JWT的token失效的解决方案
- 07-11nexus3.2重置admin密码
- 07-11mysq重置密码lERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pa
- 07-11定期批量修改远程服务器root密码
- 07-11华为交换机/路由器重置console密码
- 07-11VCSA重置SSO用户密码
- 07-11VCSA 7.0 重置root密码
- 07-11VCSA 7.0 重置root密码
- 07-11mac root用户初始密码设置
- 07-11# 单用户模式重置密码