首页  >  问答  >  正文

PHP:导入 .SQL 数据文件并管理最大执行时间

我正在尝试使用 XAMPP 中的 phpMyAdmin 导入大型 .sql 数据文件。然而,这需要花费很多时间,而且我不断得到:

致命错误:第 285 行 C:xamppphpMyAdminlibrariesdbiDBIMysqli.class.php 中的最大执行时间超过 300 秒

该文件大约有 120 万行长。

该文件大约有 30MB 大,所以并没有那么大。我真的不明白为什么要花这么长时间。

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

这是xampp中php.ini的配置文件,出于某种原因我仍然得到

致命错误:C:xamppphpMyAdminlibrariesdbiDBIMysqli.class.php 第 285 行超出了 300 秒的最大执行时间。


P粉652523980P粉652523980340 天前636

全部回复(1)我来回复

  • P粉662361740

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

    phpMyAdmin 目录中有一个名为 $cfg['ExecTimeLimit'] 的配置变量,您可以将其设置为无论您需要什么最大执行时间。

    回复
    0
  • 取消回复