博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mysql_解决The total number of locks exceeds the lock table size错误
阅读量:5098 次
发布时间:2019-06-13

本文共 1201 字,大约阅读时间需要 4 分钟。

在操作mysql数据库表时出现以下错误。

网上google搜索相关问题,发现一位外国牛人这么解释:

  1. If you're running an operation on a large number of rows within a table that uses the InnoDB storage engine, you might see this error:
  2. ERROR 1206 (HY000): The total number of locks exceeds the lock table size
  3. MySQL is trying to tell you that it doesn't have enough room to store all of the row locks that it would need to execute your query. The only way to fix it for sure is to adjust innodb_buffer_pool_size and restart MySQL. By default, this is set to only 8MB, which is too small for anyone who is using InnoDB to do anything.
  4. If you need a temporary workaround, reduce the amount of rows you're manipulating in one query. For example, if you need to delete a million rows from a table, try to delete the records in chunks of 50,000 or 100,000 rows. If you're inserting many rows, try to insert portions of the data at a single time.

 

原来是InnoDB表执行大批量数据的更新,插入,删除操作时会出现这个问题,需要调整InnoDB全局的innodb_buffer_pool_size的值来解决这个问题,并且重启mysql服务。

查看当前数据库存储引擎,在创建时使用 ENGINE=InnoDB类型。

默认的innodb_buffer_pool_size=8M

修改 innodb_buffer_pool_size的值:

 

点击(此处)折叠或打开

  1. innodb_buffer_pool_size=64M

 

再一次重启mysql服务器,执行表操作,成功执行完毕。

转载于:https://www.cnblogs.com/gisblogs/p/4377477.html

你可能感兴趣的文章
java服务器热部署的原理
查看>>
js精确计算
查看>>
oc __weak和__strong的区别
查看>>
Unitils+hibernate+Spring+PostgreSql做dao层测试遇到的错误
查看>>
Eclipse怎么样添加智能感知提示功能(含Windows版和Mac版)
查看>>
搜索引擎与开发
查看>>
CRM2011 linq 查询
查看>>
13个小技巧帮你征服Xcode
查看>>
PowerShell基础
查看>>
linux操作技巧
查看>>
Redis文章链接
查看>>
Spring MVC中<mvc:annotation-driven />和<context:annotation-config />的区别分析
查看>>
如何拿CSDN博客上的原图
查看>>
Spring Boot集成Spring Data Reids和Spring Session实现Session共享
查看>>
linux中环境变量PATH设置错误,导致ls cd 等命令不能使用,提示:没有那个文件或目录...
查看>>
JQueryUI之Autocomplete
查看>>
MVC模式
查看>>
云存储(Swift+Keystone)部署策略
查看>>
搭建项目管理环境和IDE
查看>>
安装两个tomcat
查看>>