mysql 执行报错及解决方法 Multi-statement transaction required more than ‘max_binlog_cache_size‘
mysql數據庫執行update語句,報錯。
導入數據庫的時候報了一個錯:
Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
原因:mysql參數max_binlog_cache_size設置過小導致,默認1M
? ? ? ? ? max_binlog_cache_size 表示的是binlog 能夠使用的最大cache 內存大小.檢查binlog_cache_size的使用情況:
? ? ? ? ? 通過show global status like 'bin%';查看binlog_cache_size的使用情況。
? ? ? ? ? ??
? ? ? ? ? ? ? ----Binlog_cache_disk_use表示因為我們binlog_cache_size設計的內存不足導致緩存二進制日志用到了臨時文件的次數
? ? ? ? ? ? ? ----Binlog_cache_use??表示 用binlog_cache_size緩存的次數
? ? ? ? ? ? ? ?----Binlog_cache_disk_use 值比較大的時候要考慮適當的調高 binlog_cache_size 對應的值
查看設置大小:
mysql> show global variables like '%binlog_cache%';
解決:
cat /etc/my.cnf
max_binlog_cache_size增大
注意點:
a.max_binlog_cache_size 表示的是binlog 能夠使用的最大cache 內存大小
當我們執行多語句事務的時候 所有session的使用的內存超過max_binlog_cache_size的值時
就會報錯:“Multi-statement transaction required more than 'max_binlog_cache_size' bytes ofstorage”
b.設置太大的話,會比較消耗內存資源;設置太小又會使用到臨時文件即disk
配置:
a.配置文件設置my.cnf
binlog_cache_size?= 10M
修改配置后需要重啟才能生效:service mysql restart
?
總結
以上是生活随笔為你收集整理的mysql 执行报错及解决方法 Multi-statement transaction required more than ‘max_binlog_cache_size‘的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阿拉德之怒狂战加点(《阿拉德之怒》停运)
- 下一篇: 苹果手表id锁怎么解除(苹果官网报价)