PHP:匯入 .SQL 資料檔並管理最大執行時間
P粉652523980
P粉652523980 2023-10-15 08:34:47
0
1
630

我正在嘗試使用 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粉652523980
P粉652523980

全部回覆(1)
P粉662361740

phpMyAdmin 目錄中有一個名為 $cfg['ExecTimeLimit'] 的設定變量,您可以將其設定為無論您需要什麼最大執行時間。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!