解决The total number of locks exceeds the lock table size错误

参考:https://blog.csdn.net/weixin_40683253/article/details/80762583

mysql在进行大批量的数据操作时,会报“The total number of locks exceeds the lock table size”,特别是执行create、update语句的时候,

在出现错误的那段查询语句之前写上这么一句话:

show variables like "%_buffer%";
SET GLOBAL innodb_buffer_pool_size=67108864;
问题就解决了。

启动MySQL时就要分配并且总是存在的全局缓存。

目前有:

key_buffer_size(默认值:402653184,即384M)、

innodb_buffer_pool_size(默认值:134217728即:128M)、

innodb_additional_mem_pool_size(默认值:8388608即:8M)、

innodb_log_buffer_size(默认值:8388608即:8M)、

query_cache_size(默认值:33554432即:32M)等五个。总共:560M.


mysql出现size报错时,一般是这几个值得问题,而这些变量值都可以通过命令如:show variables like '变量名';查看到,并且通过命令如:SET GLOBAL '变量名'='修改后的数值';更改。

原文地址:https://www.cnblogs.com/qianslup/p/12071445.html