When attempting to import a gzip sql file into MySQL via phpMyAdmin I continued to get the error below. There are a couple ways to get around this issue which depend on if you have access to the server or not. Below I will describe two ways to resolve the error if you have access to the server and two ways to resolve the issue if you do not have access to the server.
Error: Script timeout passed, if you want to finish import, please resubmit same file and import will resume.
Resolution With Access To Server:
- Import Using CLI:Importing using mysql commands are much easier to complete and they are also much more effecient. Use the syntax below to import a SQL file into a MySQL database.
- mysql -u username -p databasename < mysqlfile.sql
- Modify the variables above to successfully issue this command including username, databasename, and mysqlfile.sql.</li>
- <li><strong>Modify Timeout Setting:</strong>You can modify the config.inc.php file on your server which is located inside the phpMyAdmin root directory. The setting which needs to be modified or added to the config.inc.php file is displayed below. This setting which is set in the phpMyAdmin configuration file is the specific item that causes the exact error in the title of this post.
- [sourcecode language="PHP"]
- $cfg['ExecTimeLimit'] = 0;
When you set this configuration option to 0 it means a time limit is not enforced by phpMyAdmin. Please also be aware that there are variables in your php.ini file that could limit the amount of time allowed during an HTTP POST. The php.ini file settings are max_execution_time and max_input_time. The default setting for ExecTimeLimit is 300 seconds.
Resolution Without Access To Server:
- Continue Uploading:If you continue uploading the same gzip, sql, zip, or bzip2 file then the data import will pick up where it left off.
- Split SQL File:If you are not uploading SQL directly but have it compressed using gzip, zip, or bzip2 then uncompress the file. Once the file is raw SQL you can open it in a notepad, I prefer NotePad++, and view the contents. You can split the file into however many pieces you like by cutting sections of the file out but make sure that you do it on a table by table basis so the SQL statements are not split in half.
Hopefully that saves you some time. It took me awhile to figure out what settings I could modify to get past the error I received and even though I knew there were other ways around it I still wanted to set out to correct the issue how I first attempted to do so.