How to upload large database files to phpmyadmin

I was recently trying to import a large database, which was of 2GB to my localhost’s phpmyadmin. It constantly timed out and failed even after multiple attempts. So finally, I figured out a way to upload large sized mysql database to the server without any hassels. And unlike some riddles, size doesn’t matter here at all.

Generally, when you upload a database which is of more then 200 MB’s, phpmyadmin suffers a lot. Now, this totally depends on the processor and resources of the system, but I’ve had a lot of instances of phpmyadmin crashing upon import. Here is the screenshot of the error you will be getting.

“You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.”


The work around is, why not just upload the entire database via FTP to your server, and tell the server the location of it. It could save you all the time in the world and the issues with phpmyadmin.

Here are the steps that you can follow, I am doing this on my local computer, hence, my location is http://localhost. Also, if you want to, you can check a few solutions offered by phpmyadmin documentation.

1. Navigate to the config file:
C:\wamp\apps\phpmyadmin3.3.9\config.inc.php

2. Once you have the file opened, FIND for $cfg['UploadDir'].

3. Replace $cfg['UploadDir'] to $cfg['UploadDir']= ‘upload’;

4. Create a directory inside your phpmyadmin folder called “upload”.

5. Place your large / big sql file inside that upload folder. The location should be C:\wamp\apps\phpmyadmin3.3.9\upload\

You are all good to go now. From now on, whenever you’d visit the IMPORT page of phpmyadmin to import a database, you will see an additional drop down menu which will list the databases that you placed within ‘upload’ folder.

Just in case you wanted to do this on your actual server, the method would be the same, just the path changes according to the operating system and configuration.

Incoming search terms:

2 Responses to “How to upload large database files to phpmyadmin”

  1. subhash chandra says:

    Sounds good. Just before 5 days I had to upload 150 MB DB and my Phpmyadmin was freezing too. Had to use a thirdpary app . I wish i knew it previously . i could have asked my host to modify the file for me.

  2. Matera the Mad says:

    Nice solution! I’m sure I’ll run into this problem sooner than I think; I’ll (try to) remember this.

Leave a Reply

*
Premium Wordpress Themes