impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage isolation level is READ COMMITTED or READ UNCOMMITTED

执行jdbc查询时抛出异常:

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.

原因及解决方案

This is required by MySQL:

Statement based binlogging does not work in isolation level
READ UNCOMMITTED and READ COMMITTED since the necessary
locks cannot be taken.

根据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。

原文地址:https://www.cnblogs.com/wang-yaz/p/12357875.html

时间: 2024-08-06 19:58:59

impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage isolation level is READ COMMITTED or READ UNCOMMITTED的相关文章

JAVA调用mysql数据操作时出现错误:impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'

使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINLOG_FORM ActiveMQ中如果使用mysql innodb的同时,开启了binlog,那么在ack消息的时候,日志里就可会报错:java.sql.SQLException: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATE

ActiveMQ中使用mysql做持久化报错:Cannot execute statement: impossible to write to binary log since BINLOG_FORM

ActiveMQ中如果使用mysql innodb的同时,开启了binlog,那么在ack消息的时候,日志里就可会报错:java.sql.SQLException: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited

Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.

一.问题描述  014-12-15 20:00:29 4398 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafe Statement: INSERT INTO 

MySQL 二进制日志(Binary Log)

同大多数关系型数据库一样,日志文件是MySQL数据库的重要组成部分.MySQL有几种不同的日志文件,通常包括错误日志文件,二进制日志,通用日志,慢查询日志,等等.这些日志可以帮助我们定位mysqld内部发生的事件,数据库性能故障,记录数据的变更历史,用户恢复数据库等等.二进制日志,也叫binary log,是MySQL Server中最为重要的日志之一,本文主要描述二进制日志. 1.MySQL日志文件系统的组成   a.错误日志:记录启动.运行或停止mysqld时出现的问题.   b.通用日志:

MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT...

1:错误日志大量错误 150602 14:40:02 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT

Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'

[[email protected] bin]# mysqlbinlog logbin.000002 /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @[email protected]@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #150511 20:57:36 server id 1 end_log_pos 106 Start:

关于binary log那些事

阅读目录(Content) 1 what's binary log 2 Binary Logging Options and Variables 2.1 基础参数 2.2 重要参数(sync_binlog=0丢失数据的描述有疑问,目前查阅相关资料跟咨询业界人士中....) 3 Binary Logging Formats 3.1 binlog_format=statement 3.2 binlog_format=row 3.2.1 binlog_row_image默认full,binlog_ro

关于binary log一点总结[转]

阅读目录(Content) 1 what's binary log 2 Binary Logging Options and Variables 2.1 基础参数 3 Binary Logging Formats 3.1 binlog_format=statement 3.2 binlog_format=row 3.2.1 binlog_row_image默认full,binlog_rows_query_log_events默认false 3.2.2 binlog_rows_query_log_

MySQL二进制日志(binary log)总结

本文出处:http://www.cnblogs.com/wy123/p/7182356.html (保留出处并非什么原创作品权利,本人拙作还远远达不到,仅仅是为了链接到原文,因为后续对可能存在的一些错误进行修正或补充,无他) 今天无意中发现了一个云栖社区举行的MySQL“第一季:挑战玄惭之 慢SQL性能优化赛”,在测试服务器上执行其测试脚本写入数据的时候报错提示如下,Multi-statement transaction required more than 'max_binlog_cache_