简体   繁体   English

phpMyAdmin 超时不考虑 PHP.ini max_execution_time

[英]phpMyAdmin timeout not respecting PHP.ini max_execution_time

Trying to import a 150MB.sql.zip file into WAMP phpMyAdmin using this method (saving the import file in c:/wamp/sql, and editing C:\wamp\apps\phpmyadmin5.0.2\config.inc.php to include $cfg['UploadDir'] = 'C:\wamp\sql'; at the end, then an option to import the file save to C:\wamp\sql during the import process. Trying to import a 150MB.sql.zip file into WAMP phpMyAdmin using this method (saving the import file in c:/wamp/sql, and editing C:\wamp\apps\phpmyadmin5.0.2\config.inc.php to include $cfg['UploadDir'] = 'C:\wamp\sql';最后,在导入过程中选择导入文件保存到C:\wamp\sql

However, I keep receiving a timeout error in phpMyAdmin, with advice to rerun the import selecting the same file, but on the 2nd run I always receive SQL errors.但是,我在 phpMyAdmin 中不断收到超时错误,建议选择相同的文件重新运行导入,但在第二次运行时,我总是收到 SQL 错误。

So, I've set max_execution_time = 4500 in Wamp's PHP.ini (4500 seconds equals 75 minutes) and restarted Apache and MySQL.因此,我在 Wamp 的PHP.ini中设置了max_execution_time = 4500 (4500 秒等于 75 分钟)并重新启动了 Apache 和 Z62A004B959146BB97541AFA46BB97541AFA43。

However, the same timeout error occurs when using the same import process.但是,使用相同的导入过程时会出现相同的超时错误。 The timeout error occurs after about 5 minutes.大约 5 分钟后发生超时错误。

Why is the timeout error occurring within 5 minutes and not within the time set by PHP.ini max_execution_time = 4500 ?为什么超时错误发生在 5 分钟内,而不是在 PHP.ini max_execution_time = 4500设置的时间内?

Edit编辑

phpinfo says localhost has: phpinfo 说 localhost 有:

memory_limit    200M
post_max_size   200M
upload_max_filesize 200M
max_execution_time  4500

I continue to receive the message that a timeout has occurred and to rerun the import again with the same file, but on the 2nd run, I receive an error:我继续收到发生超时的消息,并使用相同的文件再次重新运行导入,但在第二次运行时,我收到一个错误:

Error Static analysis:错误Static分析:

2 errors were found during analysis.

Unexpected beginning of statement. (near "RT" at position 0)
Unrecognized statement type. (near "INTO" at position 3)

SQL query: Copy

RT INTO `cache_menu` 

It looks like the SQL INSERT command is being cut by the process.看起来 SQL INSERT 命令正在被进程剪切。

How can I safely split the SQL into smaller chunks?如何安全地将 SQL 分成更小的块?

Apart from maximum execution time, PHP will also have limits on post maximum size, memory limit, upload max filesize.除了最大执行时间外,PHP 还将限制帖子最大大小、memory 限制、上传最大文件大小。 (all of them can be related to the upload file operation for data import). (都可以与数据导入的上传文件操作相关)。 If any one of them reaches the allowed limit, will cause failure of the execution and throw a time-out error如果其中任何一个达到允许的限制,将导致执行失败并抛出超时错误

Hence you may set /change the following因此,您可以设置/更改以下内容

ini_set('memory_limit', '40M'); 
ini_set('max_execution_time', 80000); 
ini_set('post_max_size', '40M'); 
ini_set('upload_max_filesize', '40M'); 

I am unsure if this is an adequate solution for someone encountering the same problem but my workaround was to split the large SQL file into smaller files using SQL Dump File Splitter我不确定这对于遇到相同问题的人来说是否是一个足够的解决方案,但我的解决方法是使用SQL 转储文件拆分器将大型 SQL 文件拆分为较小的文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM