Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: maximum execution time when importing .SQL data file

I am trying to import a large .sql data file using phpMyAdmin in XAMPP. However this is taking a lot of time and I keep getting:

Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\phpMyAdmin\libraries\dbi\DBIMysqli.class.php on line 285

And the file is about 1.2 million lines long.

The file is about 30MB big, so it is not that big. I don't really understand why it is taking so long.

;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;;  ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time=30000  ; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly ; long running scripts. ; Note: This directive is hardcoded to -1 for the CLI SAPI ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time max_input_time=60  ; Maximum input variable nesting level ; http://php.net/max-input-nesting-level ;max_input_nesting_level = 64  ; How many GET/POST/COOKIE input variables may be accepted ; max_input_vars = 1000  ; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit=200M 

The is the config file for php.ini in xampp, for some reason i still get

Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\phpMyAdmin\libraries\dbi\DBIMysqli.class.php on line 285.

like image 265
EssexPN Avatar asked Apr 02 '14 16:04

EssexPN


People also ask

How do you fix maximum execution time of 60 seconds exceeded?

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.

How do I change the maximum execution time in MySQL?

SET GLOBAL MAX_EXECUTION_TIME=1000; Then any SELECT statement run against this MySQL instance will be aborted if it takes more than 1 second to complete. The default for the GLOBAL variable is 0, which means that there is no global time limit.

How can I increase my database execution time?

You can do this in two ways. At the start of your php file add the code set_time_limit(number in seconds); You can edit your php. ini files max_execution_time = 3000 to a higher value.


1 Answers

There's a configuration variable within the phpMyAdmin directory that you can find in libraries\config.default.php called $cfg['ExecTimeLimit'] that you can set to whatever maximum execution time you need.

like image 131
Randell Avatar answered Sep 19 '22 11:09

Randell