set global gtid_mode='OFF_PERMISSIVE'; set global gtid_mode='ON_PERMISSIVE'; set global enforce_gtid_consistency=ON; set global gtid_mode='ON';
主中插入数据,并查看主的状态
mysql> create database test02; mysql> show master status; +------------------+----------+--------------+------------------+----------------------------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +------------------+----------+--------------+------------------+----------------------------------------+ | mysql-bin.000005 | 154 | | | 82b160c7-9a8f-11e6-8412-000c29c6361d:1 | +------------------+----------+--------------+------------------+----------------------------------------+ 1 row in set (0.00 sec)
在线关
从机执行以下命令
stop slave; set global gtid_mode='ON_PERMISSIVE'; set global gtid_mode='OFF_PERMISSIVE'; CHANGE MASTER TO MASTER_AUTO_POSITION=0; set global gtid_mode='OFF';
主库执行以下命令:
set global gtid_mode='ON_PERMISSIVE'; set global gtid_mode='OFF_PERMISSIVE'; CHANGE MASTER TO MASTER_AUTO_POSITION=0; set global gtid_mode='OFF';