我收到错误消息" ERROR 1206(HY000):锁的总数超过了锁定表的大小"在运行查询时。经过几次搜索后,我了解到增加innodb_buffer_pool_size应解决此问题。但是我在这方面遇到了一些麻烦。
我使用MySQL Workbench 6.3 CE并找到一个名为" ... \ MySQL \ MySQL Server 5.6 \ my-default.ini"的文件。我找不到任何名为my.ini或my.cnf的文件。根据本网站上其他问题的答案,我编辑了这个文件,以便阅读
部分[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
现在读取
[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
然而,这似乎与原始错误没有区别,当我运行
时SELECT variable_value FROM information_schema.global_variables
WHERE variable_name = 'innodb_buffer_pool_size';
它返回的大小没有区别:263,192,576。
我已尝试创建my-default.ini的副本并将其另存为my.ini,但这也无济于事。
任何帮助都会受到大力赞赏!
答案 0 :(得分:0)
感谢Dragonthoughts,我搜索了无锁提示的信息并找到了这个 - Any way to select without causing locking in MySQL?
然后我使用了以下代码
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 ;
这似乎有用。