zoukankan      html  css  js  c++  java
  • mysql报错Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage

    mysql报错Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage

    在执行create table  xx  as  select xx的时候

    或者在执行

    tpcc-mysql的tpcc_load 的时候

    都会遇到这个错误

    1534, HY000, Writing one row to the row-based binary log failed
    Retrying ...

    1197, HY000, Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
    Retrying ...

    因为使用的是腾讯云主机,1核1G内存,内存不足导致的binlog cache size不够不能写入binlog,导致语句无法执行

    解决办法:

    修改my.cnf,增大binlog_cache_size和max_binlog_cache_size参数的值

    binlog_cache_size = 20M
    max_binlog_cache_size = 100M


    今天备份表数据遇到一个错误  Error CODE: 1197 Multi-statement TRANSACTION required more THAN 'max_binlog_cache_size' bytes of STORAGE

    版本:mysql5.6.35

    系统:centos6.5

    下面是备份语句

    CREATE TABLE FONTANA_BETSBAK AS SELECT * FROM FONTANA_BETS; 
    Error CODE: 1197
    Multi-statement TRANSACTION required more THAN 'max_binlog_cache_size' bytes of STORAGE; increase this mysqld variable AND try again

    上网搜了一下,发现是max_binlog_cache_size设置得不够大的原因

    对Innodb引擎
    由于innodb是事务型的,所以会把load文件的整个操作当作一个事务来处理,
    中途中断load操作,会导致回滚。 
    与此相关的一些参数:
    max_binlog_cache_size----能够使用的最大cache内存大小。
    当执行多语句事务时,max_binlog_cache_size如果不够大,
    系统可能会报出“Multi-statement
    transaction required more than 'max_binlog_cache_size' bytes of storage”的错误。
     备注:以load data 来说,如果load的文件大小为512M,在执行load 的过程中,
    所有产生的binlog会先写入binlog_cache_size,直到load data 的操作结束后,
    最后,再由binlog_cache_size 写入二进制日志,如mysql-bin.0000008等。
    所以此参数的大小必须大于所要load 的文件的大小,或者当前所要进行的事务操作的大小。

    改大max_binlog_cache_size 和binlog_cache_size  问题解决

    SET GLOBAL max_binlog_cache_size =20971520;
    SET GLOBAL binlog_cache_size =20971520;
  • 相关阅读:
    poj 3669 Meteor Shower
    poj 3009 Curling 2.0
    poj 1979 Red and Black
    区间内素数的筛选
    九度oj 题目1347:孤岛连通工程
    poj 3723 Conscription
    poj 3255 Roadblocks
    Luogu P3975 [TJOI2015]弦论
    AT2165 Median Pyramid Hard 二分答案 脑洞题
    后缀自动机多图详解(代码实现)
  • 原文地址:https://www.cnblogs.com/MYSQLZOUQI/p/6820688.html
Copyright © 2011-2022 走看看