Tuesday, 13 November 2018

Mysql: Maximum execution time in phpMyadmin

When I try to execute (some) queries in phpMyadmin I get this error
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140
because I have a very large table (over 9 millions records)
I have edited the file C:\xampp\php\php.ini
and changed the value of "max execution time" from 60 to 1000 then restarts the PHP and still have the same error.
Any solution?

 Answers


I have the same error, please go to
xampp\phpMyAdmin\libraries\config.default.php
Look for : $cfg['ExecTimeLimit'] = 600;
You can change '600' to any higher value, like '6000'.
Maximum execution time in seconds is (0 for no limit).
This will fix your error.



I faced the same problem while executing a curl. I got it right when I changed the following in the php.ini file:
max_execution_time = 1000 ;
and also
max_input_time = 1000 ;
Probably your problem should be solved by making above two changes and restarting the apache server.
Even after changing the above the problem persists and if you think it's because of some database operation using mysql you can try changing this also:
mysql.connect_timeout = 1000 ; // this is not neccessary
All this should be changed in php.ini file and apache server should be restarted to see the changes.



Changing php.ini for a web application requires restarting Apache.
You should verify that the change took place by running a PHP script that executes the function phpinfo(). The output of that function will tell you a lot of PHP parameters, including the timeout value.
You might also have changed a copy of php.ini that is not the same file used by Apache.



In php.ini you must check mysql.connect_timeout either. That's responsible for socket closing and returning the Fatal. So, for example, change it to:
mysql.connect_timeout = 3600
That time will be always counted in seconds, so in my example you have 1 hour.



'ZERO' for unlimited time.
C:\Apache24\htdocs\phpmyadmin\libraries\Config.class.php
/**
 * maximum execution time in seconds (0 for no limit)
 *
 * @global integer $cfg['ExecTimeLimit']
 */
$cfg['ExecTimeLimit'] = 0;

You could also import the large file right from MySQL as query or a PHP query.
500,000 rows just took me 18 seconds to import on local server, using this method.
(create table first) - then:
LOAD DATA LOCAL INFILE 'Path_To_Your_File.csv' 
INTO TABLE Your_Table_Name 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 



Go to xampp/php/php.ini
Find this line:
max_execution_time=30
And change its value to any number you want. Restart Apache.

0 comments:

Post a Comment