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
- [/sourcecode]
- 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.
Wow thanks, so well put even I guy like me can seem to understand the instructions.
Hello Abe1205,
Thanks for taking the time to leave a response. Glad the above article helped you out.
Thank Alex, these tips really help me.
Turyenle
Hello Truyenle,
No problem. Thanks for taking time to leave feedback.
Thanks.
alex
Good information, thanks for working this out and publishing it.
$cfg[‘ExecTimeLimit’] = 0; — this worked for me, got me past the timeout so I could upload my sql database.
I tried “Continue uploading” but that failed with a message about a database not selected.
Thanks again,
Bruce
Hello Bruce,
No problem. Thanks for taking the time to post feedback.
Thanks.
alex
Thanx Alex,
$cfg[‘ExecTimeLimit’] = 0;
made the job.
Pepe
Hello Pepe,
No problem at all. Glad to hear that the information in the article helped you out. Thanks for taking the time to post feedback.
Thanks.
alex
Thank!!
Hello pop,
No problem. Thanks for taking the time to leave feedback.
Thanks.
alex
I have found the path of the file in /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
I did’t found in the file $cfg[‘ExecTimeLimit’] so i have inserted manually in 2 ways :
1 $cfg[‘ExecTimeLimit’] = 0; like this
and
2 //$cfg[‘ExecTimeLimit’] = 0; like this
In both cases after uploading the database i have an error like this :
There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:
—-BEGIN CUT—-
eNo1zbEKwjAYBGCh2/8U9wAxNKlByBZKqEKaxKRWcBWHQskm6NubCt54fNzZlELS6AV6CWe9hoCE
EJSnWjdE4ydfnIbiindy/1hXuuaEkBnMYP3EMNsKb0vBGO5n50ylLcXRaBx4yxXFU9wMC3lb6bg4
wi3l9SZn/KDxLPQ7oGb3zxcWUiEE
—-END CUT—-
—-BEGIN RAW—-
ERROR: C1 C2 LEN: 1 2 11
STR:
MySQL: 5.5.32-cll
USR OS, AGENT, VER: Win MOZILLA 5.0
PMA: 4.0.5
PHP VER,OS: 5.3.17 Linux
LANG: en
SQL:
—-END RAW—-
SQL query:
MySQL said: Documentation
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1