All pages
Powered by GitBook
1 of 1

Loading...

SET GLOBAL SQL_SLAVE_SKIP_COUNTER

Syntax

Description

This statement skips the next N events from the primary. This is useful for recovering from replication stops caused by a statement.

If multi-source replication is used, this statement applies to the default connection. It could be necessary to change the value of the system variable.

Note that, if the event is a , the whole transaction will be skipped. With non-transactional engines, an event is always a single statement.

This statement is valid only when the replica threads are not running. Otherwise, it produces an error.

The statement does not automatically restart the replica threads.

Example

Multi-source replication:

Multiple Replication Domains

sql_slave_skip_counter can't be used to skip transactions on a replica if is in use and if contains multiple values. In that case, you'll get an error like the following:

In order to skip transactions in cases like this, you will have to manually change .

See Also

This page is licensed: GPLv2, originally from

SET GLOBAL sql_slave_skip_counter = N
default_master_connection
transaction
GTID replication
gtid_slave_pos
gtid_domain_id
gtid_slave_pos
Selectively Skipping Replication of Binlog Events
fill_help_tables.sql
SHOW SLAVE STATUS \G
...
SET GLOBAL sql_slave_skip_counter = 1;
START SLAVE;
SET @@default_master_connection = 'master_01';
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE;
ERROR 1966 (HY000): When using parallel replication and GTID with multiple 
 replication domains, @@sql_slave_skip_counter can not be used. Instead, 
 setting @@gtid_slave_pos explicitly can be  used to skip to after a given GTID 
 position.