Max execution time error

2019-06-08 08:54发布

问题:

I have a huge csv file (Innodb) that I have to import in phpmyadmin. For the first one (almost 20mb), it worked. For the other one (almost 50mb), I got this error when I tried to import it in PhpMyAdmin:

Fatal error: Maximum execution time of 300 seconds exceeded

I'm using Easyphp,

my.ini:

bind-address = 127.0.0.1
socket      = "${path}/mysql/mysql.sock"
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 512M
table_open_cache = 128
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 512K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M


[wampmysqld]
port        = 3306
socket      = /tmp/mysql.sock
key_buffer = 384M
max_allowed_packet = 100M
table_cache = 4096
sort_buffer_size = 2M
net_buffer_length = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 64M
myisam_sort_buffer_size = 64M
basedir=c:/wamp/bin/mysql/mysql5.1.36
log-error=c:/wamp/logs/mysql.log
datadir=c:/wamp/bin/mysql/mysql5.1.36/data
thread_cache_size = 8
query_cache_size = 32M

innodb_buffer_pool_size = 384M
innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 10M
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 3600

wait_timeout = 28800

[mysqldump]
quick
max_allowed_packet = 100M

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

php.ini

;;;;;;;;;;;;;;;;;;;
; 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 = 3600

; 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 = 5000

; 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 = 2000M

How can i resolve it? Thanks

回答1:

Quickfix: Divide the CSV in smaller parts.