1、 创建复制用户,具有replication slave 权限,能保证slave把master的数据同步过去
master:
#grant replication slave on *.* to ‘rep‘@‘192.168.10.100‘ identified by ‘123456‘;
2、 开启GTID需要启用这三个参数
#GTID
gtid_mode = on
enforce-gtid-consistency = 1
log_slave_updates = 1
3、slave配置同步
#change master to master_host=‘192.168.10.99‘,master_user=‘rep‘,master_password=‘123456‘,master_port=3306,master_auto_position=1;
时间: 2024-10-21 21:26:45