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:wampappsphpmyadmin5.0.2config.inc.php
to include $cfg['UploadDir'] = 'C:wampsql';
at the end, then an option to import the file save to C:wampsql
during the import process.
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.
So, I’ve set max_execution_time = 4500
in Wamp’s PHP.ini
(4500 seconds equals 75 minutes) and restarted Apache and MySQL.
However, the same timeout error occurs when using the same import process. The timeout error occurs after about 5 minutes.
Why is the timeout error occurring within 5 minutes and not within the time set by PHP.ini max_execution_time = 4500
?
Edit
phpinfo says localhost has:
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:
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.
How can I safely split the SQL into smaller chunks?
2
Answers
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
Apart from maximum execution time, PHP will also have limits on post maximum size, memory limit, upload max filesize. (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