The total number of locks exceeds the lock table size错误(已纠正)

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

在操作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

时间: 2024-08-31 11:19:12

The total number of locks exceeds the lock table size错误(已纠正)的相关文章

[MySQL 源码]MySQL5.1版本 lock table write与DML操作产生的MySQL层/Innodb层死锁

------------- 当在set autocommit=0时,执行lock table write操作,如果此时有同一个表上进入Innodb层的DML,可能导致死锁,这种死锁MySQL不做检测,只能等待Innodb层超时,简单的分析如下: 1. 对于lock table write操作,backtrace如下: SQL :set aucommit = 0 && lock tables t1 write: mysql_execute_command     –>open_and_

在迁移邮箱时, Mailbox Size Exceeds Target Quota 2.3GB错误的解决

官方说法: http://technet.microsoft.com/en-us/library/dd297937.aspx

MySQL · 捉虫动态 · 备库1206错误问题说明

问题背景 一个用户自建MySQL,出现备库复制中断的问题,报错为slave sql thread 错误,The total number of locks exceeds the lock table size. 报错代码 这个报错在代码中的抛错逻辑为: if UT_LIST_GET_LEN(buf_pool->free) + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->curr_size / 4 文字解释是:如果buffer pool中的

HashMap , HashTable , ConcurrentHashMap 源码比较__v1.0

                   首先,HashMap , HashTable 与 ConcurrentHashMap 里面用的 都是 数组(Node<K,V>[] table; 与 Entry<?,?>[] table;),而且它们都是 transient 的,对于 transient ,效果如下: /** * The table, initialized on first use, and resized as * necessary. When allocated, le

OCP—051试题

1Z0-051 1. View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables. The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table. Similarly, the CUST_ID and TIME_ID columns are a

用于分页的存储过程

存储过程|分页 /*该存储过程用于显示注册用户的分页*/CREATE PROCEDURE usp_PagedUserReg     @iPage      int,     @iPageSize  intASBegin --关闭自动计数器功能SET NOCOUNT ON --declare variables declare  @iStart       int          -- start recorddeclare  @iEnd         int          -- end 

dba_tables和dba_segments表中块有什么区别

oracle table blocks测试 创建测试表: SQL> create table t5(id int): 表已创建. SQL> insert into t5 values(1): 已创建 1 行. SQL> insert into t5 values(2): 已创建 1 行. SQL> insert into t5 values(3): 已创建 1 行. SQL> insert into t5 values(4): 已创建 1 行. SQL> commit;

ORACLE计算表引占用空间大小

在ORACLE数据库中,如何计算一个表所占用的存储空间呢?我们可以通过系统视图DBA_SEGMENTS.USER_SEGMETNS.DBA_TABLES来查看一个表所占空间的大小,如下所示:   SELECT SEGMENT_NAME              TABLE_NAME       ,SUM(BLOCKS)               BLOCKS       ,SUM(BYTES)/(1024*1024)    "TABLE_SIZE[MB]" FROM USER_SEG

mysql Event、存储过程、表命令

  Mysql事件调度器(Event Scheduler)类似于定时器,可以在某一个时间点执行一个SQL语句或一个语句块(BEGIN ... END):或者每隔固定间隔重复执行.类似于Linux下的crontab,或Windows下的Task Scheduler.   一.事件调度器的配置 所有事件都是在事件调度线程(event scheduler thread)里面执行的:当提及事件调度器时,通常指该线程.如果用户有PROCESS权限,可以通过SHOW PROCESSLIST命令来查看该线程及