grant replication slave on . to ‘test’@’%’ identified by ‘123456’;
上面语句在mysql8中无法执行,
修改为两步:
create user ‘test’@’%’ identified by ‘123456’;
grant replication slave on . to ‘test’@’%’;
注意:master和slave的server_id不能一样,通过命令来修改:
set global server_id=2
修改后查看:
show global variables like ‘server_id’;
然后在start slave;
https://zhuanlan.zhihu.com/p/86966579