mysql主从,主主 centos7

主71
GRANT REPLICATION SLAVE,RELOAD,SUPER ON . TO slave1@’192.168.1.76’ IDENTIFIED BY ‘123456’;
从76
change master to master_host=’192.168.1.71’,master_user=’slave1’,master_password=’123456’,master_log_file=’mysql-bin.000005’,master_log_pos=796;
start slave;
show slave status \G

主76
GRANT REPLICATION SLAVE,RELOAD,SUPER ON . TO slave1@’192.168.1.71’ IDENTIFIED BY ‘123456’;
show master status;
从71
change master to master_host=’192.168.1.76’,master_user=’slave1’,master_password=’qp5h2RaMcqPF6AM6’,master_log_file=’mysql-bin.000002’,master_log_pos=550;
start slave;
show slave status \G

设置用户远程连接
grant all privileges on . to ‘root’@’%’ identified by ‘fMOui3gFmHGAcsPszybP’;

报错:
原因:是/auto.cnf里面的uuid不一致导致。
Slave I/O: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work. Error_code: 1593
解决办法:
删除auto.cnf 重启mysql数据库

报错:Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
解决办法,关闭防火墙,确定可以访问彼此:如 mysql -h192.168.1.111 -uroot -p12233 可以登录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

村长在路上

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值