mysql> CREATE TABLE `t` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `c` int(11) unsigned DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; insert into t(c) values(1),(2),(3);
insert into t(c) values(4); insert into t(c) values(5);
CHANGE MASTER TO MASTER_HOST=$host_name MASTER_PORT=$port MASTER_USER=$user_name MASTER_PASSWORD=$password MASTER_LOG_FILE=$master_log_name MASTER_LOG_POS=$master_log_pos
set global sql_slave_skip_counter=1; start slave;
GTID=source_id:transaction_id
CHANGE MASTER TO MASTER_HOST=$host_name MASTER_PORT=$port MASTER_USER=$user_name MASTER_PASSWORD=$password master_auto_position=1
set GTID_NEXT="source_id_of_Y:transaction_id"; begin; commit; set gtid_next=automatic; start slave;
select master_pos_wait(file, pos[, timeout]);
select wait_for_executed_gtid_set(gtid_set, 1);