问题:
当我开开心心修改临时密码为root时
alter user 'root'@'localhost' identified by 'root';
ERROR!
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
我以为正常,像往常一样 修改一下密码策略就好了
SHOW VARIABLES LIKE 'validate_password%';
ERROR!*2
ERROR 1820 (HY000):You must reset your password using ALTER USER statement before executing this statement.
没有重置临时密码之前你什么也做不了
解决
先设置一个合格的密码
alter user 'root'@'localhost' identified by 'Root_2024_!';
然后修改密码策略,关闭复杂的密码验证
set global validate_password.check_user_name = OFF;
🆗了
设置密码为 root
alter user 'root'@'localhost' identified by 'root';
解决撒花~
补充
补充:密码策略是干啥的

那么.policy是干啥的?

LOW-> 只验证密码长度,,1,2 自己翻译吧
3242

被折叠的 条评论
为什么被折叠?



