5.6主从同步,跳过异常语句

来源:互联网 发布:路径规划算法 编辑:程序博客网 时间:2024/06/02 04:42
场景说明:

主从同步异常,使用“show slave status\G”查看,发现如下错误。

Last_Error: Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'
Last_SQL_Errno: 1666 
Last_SQL_Error: Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'

如何跳过:

通过"show slave status"查看 

 Retrieved_Gtid_Set: 0e89e31e-6e69-11e3-92d3-000c29e23823:1-5477

执行以下语句:

stop slave;

set gtid_next="0e89e31e-6e69-11e3-92d3-000c29e23823:5477";

begin;commit;

set gtid_next='automatic';

start slave;

使用“show slave status\G”查看


             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes

完成跳过异常语句。

本bug其它解决方法:

网上的解决方法是: set session binlog_format='row';  

具体可行性,未来验证。
 
0 0
原创粉丝点击