1.登录mysql后,创建用户,命令如下:
create user 'repl1'@'192.168.40.%' identified by '123456';
repl1:用户名
IP:为网段为40的所有ip
123456:密码
2.给用户分配权限
grant replication slave on *.* to 'repl1'@'192.168.40.%' identified by '123456';
create user 'repl1'@'192.168.40.%' identified by '123456';
repl1:用户名
IP:为网段为40的所有ip
123456:密码
grant replication slave on *.* to 'repl1'@'192.168.40.%' identified by '123456';