Home > Database > Mysql Tutorial > MySQL配置文件路径及‘The total number of locks exceeds the l_MySQL

MySQL配置文件路径及‘The total number of locks exceeds the l_MySQL

WBOY
Release: 2016-06-01 13:17:48
Original
1142 people have browsed it

在删除mysql中的数据时,遇到报错:

ERROR 1206 (HY000): The total number of locks exceeds the lock table size
Copy after login

查了查,发现是mysql配置里 innodb_buffer_pool_size 这一个配置太小造成InnoDB在执行大批量数据的插入、删除时会无法执行,检查配置:

mysql> show variables like '%_buffer%';+-------------------------+---------+| Variable_name           | Value   |+-------------------------+---------+| bulk_insert_buffer_size | 8388608 || innodb_buffer_pool_size | 8388608 |
Copy after login

innodb_buffer_pool_size才8M,无语中,OP给配的果然不靠谱,设成256M,重启MySQL

innodb_buffer_pool_size = 256M
Copy after login

然后再检查配置项,发现innodb_buffer_pool_size 依然是8M,感觉很离奇,然后想到是不是配置文件没有生效,所以检查mysql引用的配置文件位置

执行

/home/mysql/bin/mysqld --verbose --help | grep -A 1 'Default options'
Copy after login

结果为

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
Copy after login

逐个检查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 |...
Copy after login

配置生效,然后再执行之前的delete操作,删除OK

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template