在操作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服务器,执行表操作,成功执行完毕。

Mysql_解决The total number of locks exceeds the lock table size错误的更多相关文章

  1. mysql 数据库缓存调优之解决The total number of locks exceeds the lock table size错误

    环境: mysql5.6.2  主从同步(备注:需操作主库和从库) 一.InnoDB表执行大批量数据的更新,插入,删除操作时会出现这个问题,需要调整InnoDB全局的innodb_buffer_poo ...

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

    参考:https://blog.csdn.net/weixin_40683253/article/details/80762583 mysql在进行大批量的数据操作时,会报“The total num ...

  3. 【转】Mysql解决The total number of locks exceeds the lock table size错误

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

  4. mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

    1. 问题背景         InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoD ...

  5. MySQL解决[Err] 1206 - The total number of locks exceeds the lock table size问题

    MySQL解决[Err] 1206 - The total number of locks exceeds the lock table size问题 查看MySQL版本:mysql>show ...

  6. 【MySQL笔记】mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

    step1:查看 1.1 Mysql命令行里输入"show engines:"查看innoddb数据引擎状态, 1.2 show variables "%_buffer% ...

  7. MySQL插入大批量数据时报错“The total number of locks exceeds the lock table size”的解决办法

    事情的原因是:我执行了一个load into语句的SQL将一个很大的文件导入到我的MySQL数据库中,执行了一段时间后报错"The total number of locks exceeds ...

  8. MYSQL 遭遇 THE TOTAL NUMBER OF LOCKS EXCEEDS THE LOCK TABLE SIZE

    今天进行MySql 一个表数据的清理,经过漫长等待后出现 The total number of locks exceeds the lock table size 提示.以为是table_cache ...

  9. mysql:The total number of locks exceeds the lock table size

    使用mysql InnoDB存储引擎进行大量数据的更新,删除的时候容易引发”The total number of locks exceeds the lock table size”问题,解决方法之 ...

随机推荐

  1. Struts2_day02

    一.内容大纲 1 结果页面配置 (1)全局结果页面 (2)局部结果页面 - 配置全局也配置局部,最终局部为准 (3)result标签type属性 - 默认值 dispatcher做转发 - redir ...

  2. 【NOI】2017 整数(BZOJ 4942,LOJ2302) 压位+线段树

    [题目]#2302. 「NOI2017」整数 [题意]有一个整数x,一开始为0.n次操作,加上a*2^b,或询问2^k位是0或1.\(n \leq 10^6,|a| \leq 10^9,0 \leq ...

  3. E1. Array and Segments (Easy version)(暴力) && E2. Array and Segments (Hard version)(线段树维护)

    题目链接: E1:http://codeforces.com/contest/1108/problem/E1 E2:http://codeforces.com/contest/1108/problem ...

  4. Dream------Hbase--0.94版本和0.98/1.X版本api变动

    Dream------Hbase--0.94版本和0.98/1.X版本api变动 网上好多说getQualifier.getValue.getRow被..Array代替了,其实并不是的. 1. Int ...

  5. contos 7创建阿里云镜像源

    今天在ESC上安装mariaDB,发现centOS 7默认的yum源上的mariaDB版本过低,然后又镜像到网易上,发现网易源上没有mariaDB,几经折腾才发现阿里镜像上mariaDB版本较新.更改 ...

  6. poj1679

    题意:给定一个无向连通图,问该图的最小生成树是否唯一. 分析:有一个定理,如果该图存在次小生成树(与原最小生成树不同,但长度小于等于原最小生成树),则一定可以通过从原最小生成树中去掉一个边并再入一个边 ...

  7. Java基础84 javaBean规范

    1.javaBean的概述 1.javaBeam(咖啡豆)是一种开发规范,也可以说是一种技术.  2.JavaBean就是一个普通java类,只要符合以下规定才能称作为javaBean:        ...

  8. KnockoutJs学习笔记(十)

    event binding主要用于为指定的事件添加相应的处理函数,可以作用于任意事件,包括keypress.mouseover.mouseout等(也包括之前提到的click,根据后面的描述,clic ...

  9. LINQ基本语句

    一.什么是LINQ 1.定义:LINQ是Language Integrate Query的缩写,它在对象和数据之间建立一种对应关系,可以使用访问内存对象的方式查询数据集合. 2.特点:由于LINQ中查 ...

  10. Mysql中count(*)和limit同时使用的问题

    1.带有count的sql语句只会返回一条记录 , 结果如下图: 2.带有limit的sql语句是最后执行的 , 以上sql语句将返回空行,因为count(*)只会使sql语句产生一条结果记录,所以后 ...