简体   繁体   English

MySQL:无法通过编辑my.ini / my.cnf增加innodb_buffer_pool_size

[英]MySQL: Can't increase innodb_buffer_pool_size by editing my.ini / my.cnf

I'm getting the error message "ERROR 1206 (HY000): The total number of locks exceeds the lock table size" when running a query. 运行查询时,我收到错误消息“错误1206(HY000):锁的总数超过了锁表的大小”。 Following a few searches I understand that increasing innodb_buffer_pool_size should resolve this. 经过几次搜索,我知道增加innodb_buffer_pool_size应该可以解决此问题。 However I'm having some trouble doing so. 但是我这样做有些麻烦。

I'm using MySQL Workbench 6.3 CE and have found a file called "...\\MySQL\\MySQL Server 5.6\\my-default.ini". 我正在使用MySQL Workbench 6.3 CE,并找到了一个名为“ ... \\ MySQL \\ MySQL Server 5.6 \\ my-default.ini”的文件。 I can't find any files called my.ini or my.cnf. 我找不到任何名为my.ini或my.cnf的文件。 Following advice from answers to other questions on this website I edited this file so that the part that read 根据本网站上其他问题的答案的建议,我编辑了此文件,以便阅读的部分

[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

now reads 现在读

[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
innodb_buffer_pool_size = 1024M

However this seems to make no difference to the original error and when I run 但是这似乎与原始错误和我运行时没有区别

SELECT variable_value FROM information_schema.global_variables
WHERE variable_name = 'innodb_buffer_pool_size';

it makes no difference to the size that gets returned: 263,192,576. 它与返回的大小没有区别:263,192,576。

I have tried creating a copy of my-default.ini and saving it as my.ini, but this doesn't help either. 我尝试创建my-default.ini的副本并将其另存为my.ini,但这也无济于事。

Any help would be massively appreciated! 任何帮助将不胜感激!

With thanks to Dragonthoughts I searched for info on the no locks hint and found this - Any way to select without causing locking in MySQL? 多亏了Dragonthoughts,我搜索了无锁提示的信息,并发现了这一点- 在不导致MySQL锁定的情况下进行选择的任何方法?

I then used the following code 然后,我使用以下代码

SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ;
Create X as Select * from Y where Z in ('2012','2013', '2014', '2015');
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ ;

Which seemed to work. 这似乎工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM