Today's Question:  What are you most afraid of as a programmer?        GIVE A SHOUT

Technical Article => Database =>  MySQL

Workaround size limit of phpMyAdmin import sql file

  Peter      2014-08-14 09:59:27      8,110    0    0

When doing website development with MySQL, we often need to do database backup and restore. For website, the data in database will grow quickly, so when we back up the database, the size of the generated sql file may be over 80MB which is the max allowed size when we want to import a sql file for restoring our database using phpMyAdmin. To workaround this limit, we need to review the documentation of phpMyAdmin. Fortunately, I found an online article written by David Pratt  which gave us a very simple solution to this problem.

Find the file located in the phpmyadmin directory. In my case it is located here:


Find the line with $cfg['UploadDir'] on it and update it to:

$cfg['UploadDir'] = 'upload';

Create a directory called ‘upload’ within the phpmyadmin directory.


Then place the large sql file that you are trying to import into the new upload directory. Now when you go onto the db import page within phpmyadmin console you will notice a drop down present that wasn’t there before – it contains all of the sql files in the upload directory that you have just created. You can now select this and begin the import.

If the import file size is too large, we may encounter another issue when importing it, that is the timeout issue. Since the default timeout is 300s which is 5 minutes. For some large files, it's not enough, we need to change the \wamp\apps\phpmyadmin4.1.14\libraries\config.default.php.

Need to update the $cfg['ExecTimeLimit'] and change it to $cfg['ExecTimeLimit'] = 0; Here 0 means infinite time limit.

Please restart all services after changing config files.

If the above settings don't work and you still get below message :

Maximum execution time of 360 seconds exceeded in C:\wamp\apps\phpmyadmin4.1.14\libraries\plugins\import\ImportSql.class.php

You should go to \wamp\alias\phpmyadmin.conf and set the php_admin_value max_execution_time to 0.

Reference : Importing large files into mysql with phpmyadmin



Share on Facebook  Share on Twitter  Share on Google+  Share on Weibo  Share on Reddit  Share on Digg  Share on Tumblr    Delicious



No comment for this article.


What is an algorithm?

By sonic0002
Do you know what is an algorithm? As a programmer, you have to know. Algorithms are word used by programmers when they do not want to explain what they did.