博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
The total number of locks exceeds the lock table size错误(已纠正)
阅读量:7044 次
发布时间:2019-06-28

本文共 1221 字,大约阅读时间需要 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的值:

vim /etc/my.cnf

点击(此处)折叠或打开

  1. innodb_buffer_pool_size=64M

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

参考:

http://blog.csdn.net/slvher/article/details/9532107

你可能感兴趣的文章
我的友情链接
查看>>
找出一个数组中唯一没有成对出现的两个数
查看>>
《Android开发从零开始》——3.第一个Android程序
查看>>
在Windows下ip地址无法解析,使用ipconfig /registerdns可以恢复正常
查看>>
我的友情链接
查看>>
Android ViewPager 设置不滑动
查看>>
laravel中HTML::style类出错解决方法
查看>>
合并排序最差效率递推式的精确解
查看>>
IOS中Foreach使用不当会引起NSGenericException
查看>>
聊聊UIView
查看>>
mysql主从
查看>>
Linux系统下转换文件编码的方法
查看>>
Excle百万数据量 导出
查看>>
云盘参数和性能测试方法
查看>>
Web前端——链接和表格使用规范
查看>>
2.6.18 32位环境 src.rpm包的使用
查看>>
Windows服务创建及安装
查看>>
Python27+Opencv3 VideoCapture FALSE问题记录
查看>>
如何在 Linux 系统查询机器最近重启时间
查看>>
jQuery插件学习(二)
查看>>