日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql 执行报错及解决方法 Multi-statement transaction required more than ‘max_binlog_cache_size‘

發(fā)布時間:2023/12/19 数据库 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql 执行报错及解决方法 Multi-statement transaction required more than ‘max_binlog_cache_size‘ 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

mysql數(shù)據(jù)庫執(zhí)行update語句,報錯。

導(dǎo)入數(shù)據(jù)庫的時候報了一個錯:

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

原因:mysql參數(shù)max_binlog_cache_size設(shè)置過小導(dǎo)致,默認(rèn)1M

? ? ? ? ? max_binlog_cache_size 表示的是binlog 能夠使用的最大cache 內(nèi)存大小.檢查binlog_cache_size的使用情況:

? ? ? ? ? 通過show global status like 'bin%';查看binlog_cache_size的使用情況。

? ? ? ? ? ??

? ? ? ? ? ? ? ----Binlog_cache_disk_use表示因為我們binlog_cache_size設(shè)計的內(nèi)存不足導(dǎo)致緩存二進(jìn)制日志用到了臨時文件的次數(shù)
? ? ? ? ? ? ? ----Binlog_cache_use??表示 用binlog_cache_size緩存的次數(shù)

? ? ? ? ? ? ? ?----Binlog_cache_disk_use 值比較大的時候要考慮適當(dāng)?shù)恼{(diào)高 binlog_cache_size 對應(yīng)的值

查看設(shè)置大小:

mysql> show global variables like '%binlog_cache%';


解決:

cat /etc/my.cnf

max_binlog_cache_size增大

注意點:

a.max_binlog_cache_size 表示的是binlog 能夠使用的最大cache 內(nèi)存大小

當(dāng)我們執(zhí)行多語句事務(wù)的時候 所有session的使用的內(nèi)存超過max_binlog_cache_size的值時

就會報錯:“Multi-statement transaction required more than 'max_binlog_cache_size' bytes ofstorage”

b.設(shè)置太大的話,會比較消耗內(nèi)存資源;設(shè)置太小又會使用到臨時文件即disk

配置:

a.配置文件設(shè)置my.cnf

binlog_cache_size?= 10M

修改配置后需要重啟才能生效:service mysql restart

?

總結(jié)

以上是生活随笔為你收集整理的mysql 执行报错及解决方法 Multi-statement transaction required more than ‘max_binlog_cache_size‘的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。