Centos7中mysql8.0.39密码设置的问题

问题:

当我开开心心修改临时密码为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 自己翻译吧

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值