Home  >  Q&A  >  body text

PHP: Import .SQL data files and manage maximum execution time

I'm trying to import a large .sql data file using phpMyAdmin in XAMPP. However, this takes a lot of time and I keep getting:

Fatal error: Maximum execution time exceeded 300 seconds in C:xamppphpMyAdminlibrariesdbiDBIMysqli.class.php on line 285

The file is approximately 1.2 million lines long.

The file is about 30MB, so it's not that big. I really don't understand why it's 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

This is the config file for php.ini in xampp, for some reason I still get

Fatal error: C:xamppphpMyAdminlibrariesdbiDBIMysqli.class.php line 285 The maximum execution time of 300 seconds was exceeded.


P粉652523980P粉652523980391 days ago681

reply all(1)I'll reply

  • P粉662361740

    P粉6623617402023-10-16 00:54:28

    There is a configuration variable in the

    phpMyAdmin directory called $cfg['ExecTimeLimit'] that you can set to whatever maximum execution time you need.

    reply
    0
  • Cancelreply