0

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.

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?

Steve
  • 2,066
  • 13
  • 60
  • 115
  • You could look in the output of `phpinfo()` to confirm that your changes have been applied correctly; it's possible there's another configuration file that loads later and overwrites your setting, or that some other problem has prevented this from activating. However, aside from that, I suggest unzipping the sql file first; phpMyAdmin should definitely be able to load a local file to a local MySQL within 5 minutes from the UploadDir location but when it has to uncompress the file first, there are many limitations that can cause problems. Try the uncompressed .sql and see if it goes better. – Isaac Bennetch Nov 29 '20 at 16:08

2 Answers2

0

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

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

Ken Lee
  • 6,985
  • 3
  • 10
  • 29
0

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

Steve
  • 2,066
  • 13
  • 60
  • 115