Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpmyadmin opens MySQL table lists very slowly

I can log into phpmyadmin and see databases very quickly. Once I click on one of them and try to see the tables list it's very slow. Is there anything I'm missing? I didn't have this situation before updating from Ubuntu 10.04 to Ubuntu 12.04.

like image 207
user1859451 Avatar asked Dec 25 '12 03:12

user1859451


3 Answers

Another source of slowness for phpMyAdmin running on a local server comes from its apparent ignoring of the hosts file. Try changing any occurrences of "localhost" in config.inc.php to "127.0.0.1". It created a great speedup for me on a Windows computer.

like image 127
David Spector Avatar answered Nov 18 '22 06:11

David Spector


Open the \config.inc.php file and append these two lines:

$cfg['MaxExactCount'] = 0;
$cfg['MaxExactCountViews'] = 0;

And of course, the second line can be skipped if there is not any view in the database.

like image 44
Shahroq Avatar answered Nov 18 '22 07:11

Shahroq


This is because you have innoDB tables with lot of rows. InnoDB does not store the number of rows in a table but MyISAM does. So for each InnoDB table PHPMyAdmin invokes SELECT count(*) FROM query which is very slow if number of rows is very high. To resolve this you should edit config.inc.php file and set $cfg['MaxExactCount']. This will invoke count(*) sql for tables that has less MaxExactCount rows.

$cfg['MaxExactCount'] = 20000;

Meaning form phpmyadmin manual

For InnoDB tables, determines for how large tables phpMyAdmin should get the exact row count using SELECT COUNT. If the approximate row count as returned by SHOW TABLE STATUS is smaller than this value, SELECT COUNT will be used, otherwise the approximate count will be used.

like image 7
Shiplu Mokaddim Avatar answered Nov 18 '22 07:11

Shiplu Mokaddim