主从不同步,经查看发现如下报错
Last_Errno: 1666
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.'

问题原因:
主从复制,从库中设定的binlog_format=statement,主库中的是MIXED,所以当从库尝试重做主库过来的过来的binlog日志,relay log的binlog_format与自己设定的binlog_format不一致。
解决方法:
直接先更改从库的binlog_format=MIXED
排查步骤:
1.查看从库binlog_format 发现是STATEMENT格式,
mysql> show variables like '%binlog_format%';
2.主库binlog_format:

发现主从数据库的binlog_format格式不一样,我们要修改从库的binlog_format格式和主库相同
3.修改从库binlog_format
mysql> set global binlog_format=MIXED;
发现没有生效
那么我们直接修改/etc/my.cnf 配置 ,添加binlog_format=mixed ,然后重启数据库生效

重启从库,主从自动开始同步