转载:

java.sql.SQLException: 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.

 

tomcat抛异常如上!

提示是事务级别在read committed和read uncommitted的时候

binlog必须设置为row格式

这个是java设置的一个局限性,java默认的事务级别是read committed,而mysql默认设置的binlog_format=statement。

将binlog_format设置为mixed

set global binlog_format=mixed;

过段时间,异常仍在!

设置成row

set global binlog_format=row;

问题解决!

或:

mysql> SET SESSION binlog_format = 'ROW';
mysql> SET GLOBAL binlog_format = 'ROW';

 

注意: 若手动修改linux下面/etc/my.cnf :  binlog_format = row  ,  需要在重启mysql是注意配置是否生效,本人测试比较难生效。

相关文章:

  • 2021-12-04
  • 2022-02-20
  • 2021-07-30
  • 2021-07-07
  • 2021-07-07
  • 2021-05-25
  • 2022-12-23
  • 2021-05-18
猜你喜欢
  • 2022-02-16
  • 2021-08-16
  • 2021-11-28
  • 2021-11-12
  • 2021-10-11
  • 2022-01-03
相关资源
相似解决方案