版本:MySql 8.0.20
如果设置密码 123456
在修改密码时遇到 Your password does not satisfy the current policy requirements
如何解决?
方案一:
设置一个符合规则的密码:Abc123...
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc123...';
方案二:
如果你就想设置 密码为 123456,怎么办?
a、先设置为符合规范的密码: Abc123...
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc123...';
b、然后查看当前默认规则:SHOW VARIABLES LIKE 'validate_password%';
c、修改校验密码策略等级
set global validate_password.policy=LOW;
d、设置密码长度至少为 6
set global validate_password.length=6;
e、最后设置 123456
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
就可以了