简体   繁体   English

phpMyAdmin在“浏览”时通过执行COUNT(*)来挂起服务器

[英]phpMyAdmin hangs server by doing a COUNT(*) when going to “Browse”

I have a very large table (~115 million rows). 我有一张很大的桌子(约1.15亿行)。 When I click it in phpMyAdmin everything blows up. 当我在phpMyAdmin中单击它时,一切都会崩溃。 By doing a SHOW PROCESSLIST; 通过执行SHOW PROCESSLIST; I can see that it's because phpMyAdmin has tried to execute the following query: 我可以看到这是因为phpMyAdmin尝试执行以下查询:

SELECT COUNT(*) FROM `friend_map`.`connections`

Since this is an innoDB table this requires a table scan and the server errors out before returning. 由于这是一个innoDB表,因此需要进行表扫描,并且服务器在返回之前会出错。

It gives the error: 它给出了错误:

Error in Processing Request
Error code: 504
Error text: Gateway Timeout

I have to manually kill the mysql process or the entire database remains unresponsive. 我必须手动杀死mysql进程,否则整个数据库仍然无法响应。

Is there a way to tell phpMyAdmin not to execute this query? 有没有办法告诉phpMyAdmin不要执行此查询?

Edit: I should probably also note that I'm in the middle of a server migration. 编辑:我可能还应该注意,我正在服务器迁移中。 This worked fine with phpMyAdmin 3.5.1 but now I've switched to new servers and this error is happening on phpMyAdmin 4.1.3. phpMyAdmin 3.5.1可以正常工作,但是现在我切换到新服务器,并且在phpMyAdmin 4.1.3上发生此错误。

This appears to be an open issue with phpMyAdmin 4.x. 这似乎是phpMyAdmin 4.x的未解决问题。 More details are here: http://sourceforge.net/p/phpmyadmin/bugs/4027/?page=0 此处有更多详细信息: http : //sourceforge.net/p/phpmyadmin/bugs/4027/?page=0

I was able to fix this by adding $force_exact = false; 我可以通过添加$force_exact = false;来解决此问题$force_exact = false; to line 573 of libraries/Table.class.php. 到library / Table.class.php的573行。

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

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