Maximum execution time in phpMyadmin
Asked Answered
C

14

138

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?

Convenient answered 12/8, 2009 at 0:32 Comment(1)
You Must require to restart your server. After Changing in config or ini file.Cattycornered
G
261

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.

Greybeard answered 13/12, 2012 at 10:46 Comment(7)
You can use code formatting to make it clear what is code and what is not as well :)Peanut
It is pretty clear (in the header of the file) that you should not edit this file. Instead, you should edit config.inc.php, adding this line, as it says in other answerDabchick
Check my answer below. That's the way to go ;)Sadi
Adding this to the config.inc.php did not do the job for me. Modifying the config.default.php helped and worked.Stickweed
For wamp path is wamp64\apps\phpmyadmin4.6.4\libraries\config.default.php OR you can find path of your phpmyadmin directory by clicking wamp tray icon > Apache > Alias Directories and edit phpmyadmin. Also as mentioned by dsnunez, it's better to edit config.inc.php --edit-- editing config.inc.php didn't work for meExhaustion
Just need to edit max_execution_time=60 in php.ini file & restart Apache server. That's worked for me.Discretional
I found config.default.php and I set the value, then restart Wamp but it is still the same. Is there some cache or something?Euphoria
S
151

For Xampp version on Windows

Add this line to xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

And Change xampp\php\php.ini to

post_max_size = 750M 
upload_max_filesize = 750M   
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

And change xampp\mysql\bin\my.ini

max_allowed_packet = 200M

Please do not forget to upvote this answer if it was helpful :)

Sadi answered 13/7, 2013 at 8:16 Comment(8)
I've been having the exact same problems except with a much smaller dataset (~120k rows) - your answer definitely made things much better :).Wizard
I got the script timeout for xampp for Windows instantly when pressing Browse on a table ~ 130mbPianoforte
Sadly $cfg['ExecTimeLimit'] = 6000; seems to have zero effect on my installation. I'd rather set it locally than in php.ini which applies to the whole server, but maybe that's the only option.Fingertip
Not sure what all the does, but you get my vote :-)Drops
This should be the "perfect" accepted answer.Joe
This worked for me in my XAMPP, although matched the existing code style: $cfg['Servers'][$i]['ExecTimeLimit'] = 6000;Peabody
i opened xampp/phpmyadmin folder in vscode and search for ExecTimeLimit and updated its value in all files where it existed. it isn't best solution but worked for meSext
When i have changed max_allowed_packet=200M my mysql module got error in xampp and after lot of debugging I didn't get the problem as i have reversed it. So i have to reinstall xampp for this.Tiny
O
16

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.

Opus answered 16/11, 2012 at 7:3 Comment(0)
V
8

Your change should work. However, there are potentially few php.ini configuration files with the 'xampp' stack. Try to identify whether or not there's an 'apache' specific php.ini. One potential location is:

C:\xampp\apache\bin\php.ini

Vue answered 12/8, 2009 at 0:37 Comment(1)
on my xampp that file in C:\xampp\php\php.ini and goto line number 442 (approximately - some time that line number will be change after the manual edit) max_execution_time = 1000 but this is not work for me. Then i'll try this on C:\xampp\phpMyAdmin\config.inc.php $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 1200;Roos
N
7

ini_set('max_execution_time', 0); or create file name called php.ini and enter the first line max_execution_time=0 then save it and put the file in your root folder of your application.

That's it. Good luck.

Nahuatl answered 11/7, 2011 at 12:24 Comment(1)
There's a set_time_limit() function. No need to (ab)use ini_set().Whitelivered
C
5

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.

Chantalchantalle answered 12/8, 2009 at 0:39 Comment(0)
A
4

What worked for me on WAMP was modifying file: \Wamp64\alias\phpmyadmin.conf, lines:

 php_admin_value max_execution_time 600
 php_admin_value max_input_time 600

I did not have to change the library file.

Anguilla answered 20/10, 2018 at 17:46 Comment(0)
H
3

Well for Wamp User,

Go to: wamp\apps\phpmyadmin3.3.9\libraries

Under line 536, locate $cfg['ExecTimeLimit'] = 0;

and change the value from 0 to 6000. e.g

$cfg['ExecTimeLimit'] = 0;

To

$cfg['ExecTimeLimit'] = 6000;

Restart wamp server and phew.

It works like magic !

Humpback answered 23/1, 2016 at 15:59 Comment(1)
This is actually wrong, should be the other way round 0 means no execution time limitGuardado
T
3

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.

Thorough answered 9/11, 2016 at 8:0 Comment(0)
I
2

'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' 
Intuition answered 10/12, 2014 at 16:55 Comment(0)
L
1

Probabily you are using XMAPP as service, to restart XMAPP properly, you have to open XMAPP control panel un-check both "Svc" mdodules against Apache and MySQL. Then click on exit, now restart XMAPP and you are done.

Lichfield answered 27/9, 2012 at 9:51 Comment(0)
S
1

Go to xampp/php/php.ini

Find this line:

max_execution_time=30

And change its value to any number you want. Restart Apache.

Spoilsport answered 29/12, 2013 at 3:15 Comment(1)
D
0

On Linux you need to create the $cfg['ExecTimeLimit'].

First, locate the PHP configuration file.

Commom locations: /etc/phpmyadmin/config.inc.php.

Edit the PHP configuration file using your preferred text editor. You'll need root or superuser privileges to do this, so use sudo.

sudo nano /etc/phpmyadmin/config.inc.php

Add the line:

$cfg['ExecTimeLimit'] = 600;

Save the changes and exit the text editor (in nano you can save by press CTRL + O, then press Enter, and exit by press CTRL + X).

After all, restart your web server to the settings take effect.

sudo service apache2 restart

Don't forget to upvote if this helped you

Dom answered 4/10, 2023 at 11:54 Comment(0)
G
0

to import big sql file use mysql workbench , it will import quickly , and will not throw any time error .

Godmother answered 18/4 at 15:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.