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.'

这是因为binlog_format的三种日志格式:

row:基于行的复制

statement:给予命令语句的复制

mixed:二者综合

如果有不确定因素的插入,给予语句的复制则可能导致主从复制失败!

譬如unix_timestamp、uuid、insert ...select语句!

我这里出现 Last_SQL_Errno: 1666号错误的原因是主机是statementbinlog格式,而从机是mixed,

并且我在主机执行了insert into a select * from 类型的语句!

将主机的binlog_format改为mixed

在从机stop slave;

start slave;

show slave status\G

主从复制正常!