开启binlog后异常:impossible to write to binary log since BINLOG_FORMAT = STATEMENT
2017-06-11 00:38
537 查看
问题
在实现数据库主备同步的时候,owncloud出现了异常。General error: 1665 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
解释
这是因为,mysql默认的binlog_format是STATEMENT。从 MySQL 5.1.12 开始,可以用以下三种模式来实现:基于SQL语句的复制(statement-based replication, SBR),基于行的复制(row-based replication, RBR),混合模式复制(mixed-based replication, MBR)。相应地,binlog的格式也有三种:STATEMENT,ROW,MIXED。
如果你采用默认隔离级别REPEATABLE-READ,那么建议binlog_format=ROW。如果你是READ-COMMITTED隔离级别,binlog_format=MIXED和binlog_format=ROW效果是一样的,binlog记录的格式都是ROW,对主从复制来说是很安全的参数。
解决方案
方法一
mysql> STOP SLAVE; Query OK, 0 rows affected (0.02 sec) mysql> SET GLOBAL binlog_format=ROW; Query OK, 0 rows affected (0.00 sec) mysql> START SLAVE; Query OK, 0 rows affected (0.00 sec)
但是这样只是一次性的,重启后失效。
方案二
永久生效,需要修改my.ini# binary logging format - ROW binlog_format=ROW
参考资料:
网上资源
备注:
转载请注明出处:http://blog.csdn.net/wsyw126/article/details/73011497
作者:WSYW126
相关文章推荐
- [MySQL复制异常]'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'
- impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT
- Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT…
- JAVA调用mysql数据操作时出现错误:impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'
- ERROR 1665 (HY000): Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT
- [MySQL复制异常]Cannot execute statement: impossible to write to binary log since statement is in row for
- ActiveMQ中使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINLOG_FORM
- 【转】[MySQL复制异常]Cannot execute statement: impossible to write to binary log since statement is in row for
- ActiveMQ中使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINLOG_FORM
- [MySQL复制异常]Cannot execute statement: impossible to write to binary log since statement is in row for
- Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. S
- Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.
- JMS之—— ActiveMQ中使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINL
- 解决 "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
- Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. S
- MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM
- Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.
- MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT...
- Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.
- MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM