mysql主从,主主 centos7

来源:互联网 发布:电信宽带网络测速 编辑:程序博客网 时间:2024/06/05 02:41

主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 可以登录

0 0
原创粉丝点击