Question

It keeps loading while trying to import even small sized sql files to phpmyadmin on WampServer installed on Windows 8. I get following error

Fatal error: Maximum execution time of 300 seconds exceeded in D:\wamp\apps\phpmyadmin4.0.4\libraries\dbi\mysqli.dbi.lib.php on line 267

I have included error log below.

[Mon Mar 17 19:03:20.009137 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP Fatal error:  Maximum execution time of 300 seconds exceeded in D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\dbi\\mysqli.dbi.lib.php on line 267, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:03:20.009137 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP Stack trace:, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:03:20.009137 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP   1. {main}() D:\\wamp\\apps\\phpmyadmin4.0.4\\import.php:0, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:03:20.009137 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP   2. ImportSql->doImport() D:\\wamp\\apps\\phpmyadmin4.0.4\\import.php:489, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:03:20.009137 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP   3. PMA_importRunQuery() D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\plugins\\import\\ImportSql.class.php:414, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:03:20.009137 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP   4. PMA_DBI_try_query() D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\import.lib.php:158, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:03:20.010143 2014] [:error] [pid 5160:tid 1672] [client ::1:55653] PHP   5. PMA_DBI_real_query() D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\database_interface.lib.php:192, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP Fatal error:  Maximum execution time of 300 seconds exceeded in D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\dbi\\mysqli.dbi.lib.php on line 267, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP Stack trace:, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP   1. {main}() D:\\wamp\\apps\\phpmyadmin4.0.4\\import.php:0, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP   2. ImportSql->doImport() D:\\wamp\\apps\\phpmyadmin4.0.4\\import.php:489, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP   3. PMA_importRunQuery() D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\plugins\\import\\ImportSql.class.php:414, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP   4. PMA_DBI_try_query() D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\import.lib.php:158, referer: http://localhost/phpmyadmin/import.php
[Mon Mar 17 19:09:23.798129 2014] [:error] [pid 5160:tid 1672] [client ::1:55969] PHP   5. PMA_DBI_real_query() D:\\wamp\\apps\\phpmyadmin4.0.4\\libraries\\database_interface.lib.php:192, referer: http://localhost/phpmyadmin/import.php
Was it helpful?

Solution

Well of course the reason is that phpMyAdmin is a php app and therefore is limited by the max_execution_time in php.ini

Solution 1 is to change your php.ini file and increase the exec time like so

max_execution_time = 2000

Solution 2 Would be to just increase the time for the phpMyAdmin app like so

Edit \wamp\alias\phpmyadmin.conf and add these lines to that file just after the Alias /phpmyadmin ..... line

php_admin_value max_execution_time 2000
php_admin_value max_input_time 2000

Solution 3. The best solution in my mind for restoring large database dumps is to use the MySQL Console as this is not limited in any way and will just run until your backup file is completely processed.

left click wampmanager icon -> MySQL -> MySQL Console Enter your 'root' password or just hit enter is you have no password on the 'root' userid.

Then enter this command as the mysql > prompt

source path/to/the/backup/file.sql

If you take option 1 or 2 dont forget to set the max_execution_time back to no more than 60 seconds. If you ever make the mistake ( and none of us are perfect) of writing an infinite loop in PHP code the PHP code will run for max_execution_time before giving an error. This can be very confusing if it runs for 2000/60 = 33.5 minutes before giving you a clue to your error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top