Tuesday, March 22, 2011

Why not SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2 ?

If you decide that you can skip the next statement from the master, issue the following statements: 
mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = n; 
mysql> START SLAVE;
The value of n should be 1 if the next statement from the master does not use AUTO_INCREMENT or LAST_INSERT_ID(). Otherwise, the value should be 2. The reason for using a value of 2 for statements that use AUTO_INCREMENT or LAST_INSERT_ID() is that they take two events in the binary log of the master.
Reference: http://lists.mysql.com/mysql/204875

No comments: