mysql5.7主从

create database demo;

GRANT all ON demo.* TO xxx@'%' IDENTIFIED BY 'xxxxxx';

flush privileges; 

1:配置

stop slave;
change master to master_host='IP',master_user='xxx',master_password='xxxxxx',master_log_file='mysql-bin.000002',master_log_pos=9076;
start slave;

------------------
stop slave;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
start slave;

2:The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.

[root@iZbpycie06u04lZ ~]# cat /usr/local/mysql/data/auto.cnf
[auto]
server-uuid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[root@iZbpycie06u04lZ ~]# vi /usr/local/mysql/data/auto.cnf

3:Master command COM_REGISTER_SLAVE failed: Access denied for user 'root'@'%' (using password: YES) (Errno: 1045)

GRANT REPLICATION SLAVE ON *.* TO xxxxxx@'%' IDENTIFIED BY 'xxxxxx';
flush privileges;

展开阅读全文

没有更多推荐了,返回首页