MySQL配置文件路径及‘The total number of locks exceeds the l_MySQL
程序员文章站
2022-05-20 15:17:09
...
在删除mysql中的数据时,遇到报错:
ERROR 1206 (HY000): The total number of locks exceeds the lock table size
查了查,发现是mysql配置里 innodb_buffer_pool_size 这一个配置太小造成InnoDB在执行大批量数据的插入、删除时会无法执行,检查配置:
mysql> show variables like '%_buffer%';+-------------------------+---------+| Variable_name | Value |+-------------------------+---------+| bulk_insert_buffer_size | 8388608 || innodb_buffer_pool_size | 8388608 |
innodb_buffer_pool_size才8M,无语中,OP给配的果然不靠谱,设成256M,重启MySQL
innodb_buffer_pool_size = 256M
然后再检查配置项,发现innodb_buffer_pool_size 依然是8M,感觉很离奇,然后想到是不是配置文件没有生效,所以检查mysql引用的配置文件位置
执行
/home/mysql/bin/mysqld --verbose --help | grep -A 1 'Default options'
结果为
Default options are read from the following files in the given order:/etc/my.cnf /etc/mysql/my.cnf /home/mysql/etc/my.cnf ~/.my.cnf
逐个检查my.cnf,发现根本就没对应的文件,OP给配的果然不靠谱。。
把my.cnf复制到 /home/mysql/etc/ 路径下,重启mysql,检查InnoDB变量
mysql> show variables like '%_buffer%';+-------------------------+-----------+| Variable_name | Value |+-------------------------+-----------+| bulk_insert_buffer_size | 8388608 || innodb_buffer_pool_size | 268435456 |...
配置生效,然后再执行之前的delete操作,删除OK
推荐阅读
-
Mysql解决The total number of locks exceeds the lock table size报错
-
Mysql解决The total number of locks exceeds the lock table size错误
-
MySQL配置文件路径及‘The total number of locks exceeds the l_MySQL
-
MySQL配置文件路径及‘The total number of locks exceeds the l_MySQL
-
Mysql解决The total number of locks exceeds the lock table size报错