问题是在配置MySQL主从机时候,需要授权出现密码不满足当前政策要求(密码安全等级)。
我出现错误的时候是,grant授权的时候。
首先查看一下密码安全设置
SHOW VARIABLES LIKE 'validate_password%';
如果如下图,已经将等级全部调到最低了
如果不是最低权限,设置为最低权限
set global validate_password_policy=LOW; \\等级
set global validate_password_length=6; \\长度
对从库授权:
grant replication slave on *.* to 'duomu'@'192.168.102.135';
但是还是报错: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
原因是,我设置用户的时候,没有设置192.168.102.135的用户密码,这就相当于空密码。
查看用户信息
use mysql
select host,user,authentication_string,plugin from user;
可以看到没有192.168.102.135的用户
创建用户
create user 'duomu'@'192.168.102.135' identified by '123456' password expire never;
grant all privileges on duomu.* to 'duomu'@'192.168.102.135';
再次查看,可以看到添加了192.168.102.135用户