java默认事务级别read committed对binlog_format的需求
2016-03-22 13:47
471 查看
ava.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是注意配置是否生效,本人测试比较难生效。
mysql>
mysql>
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是注意配置是否生效,本人测试比较难生效。
mysql> [code]SET GLOBAL binlog_format = 'STATEMENT';
mysql>
SET GLOBAL binlog_format = 'ROW';
mysql>
SET GLOBAL binlog_format = 'MIXED';
相关文章推荐
- eclipse中 linked resource的使用
- Eclipse 安装反编译插件
- Eclipse-JEE解决Cannot change version of project facet Dynamic web module to 2.4
- JavaWeb动态导出Excel可弹出下载
- HDU2019JAVA
- SpringBoot使用的心得记录
- Java基础之static的使用
- Spring 一二事(9) - xml 形式的 AOP
- java将字符串进行MD5加密和将时间戳格式化输出的方法
- java编程,ATM简例。
- Java Generics and Collections-2.2
- JAVA集合的学习
- java序列化和反序列话总结
- java-volatile
- spring 加载多个资源文件
- Java多线程中Synchronized简介和Static Synchronized的区别
- spring mvc ehcache 详细配置 亲测可用
- 解决eclipse中maven出现的Failure to transfer XXX.jar的问题
- Intelli IDEA与java/maven
- java函数调用