BigDump: how to import large data to MySQL online

Advertisement
When you migrate your website from localhost to the live server in Internet, you probably have to solve one big (well, not so) problem. This problem is phpMyAdmin file size limit for importing large SQL dump scripts. Yes, you can try to edit your php.ini and allow bigger size for uploading files and extend the limit for script execution. However this doesn't help every time. And the another thing. When you move your live website and have 100 MB or more SQL dump, the phpMyAdmin is not useable. But, don't worry, there is a free solution which helps.

When I moved some of my website from the old webhosting provider to the HostGator, I found one problem. The phpMyAdmin in their cPanel was unable to import large SQL files which I exported via mysqldump command from the previous location. Yes, there is a customer support by HostGator and they can import your SQL scripts you upload to your web account. However I didn't find this way comfortable because I simply do not like to wait for anyone. So I decided to find or create a script which could import the SQL dump file the better way than phpMyAdmin in HostGator's cPanel. Luckily, I have found BigDump script and save my developer time ;-)

How to import MySQL database using BigDump

You can find the BigDump script at www.ozerov.de/bigdump.php. It is only one simple PHP file which will do the job perfectly.So the first step is to upload your SQL file to the server. The next step is to edit the bigdump.php file. But don't worry, there are only few lines you need to edit for preparing for your import.

The first section needs to setup database connection. So provide your database host, name and login information:

$db_server   = 'localhost';
$db_name     = 'mydatabase';
$db_username = 'myusername';
$db_password = 'mystrongpassword';

The second section in the bigdump.php file is optional, however you can specify the SQL script file name:

$filename         = 'databasedump.sql';

Save the file and upload it to the same location as your SQL file. Now point your web browser to this bigdump.php file. If you didn't specify a SQL file name in config section, you will be asked for it. If you did it, you should see the similar screen:

[inline:bigdump-1.png]

So click the Start import link and the progress information will appear. It should look like this:

[inline:bigdump-2.png]

As soon as the SQL import is done, you can delete the SQL dump and bigdump.php files from the server and start using your imported database. Using the BigDump script is fast and easy. Moreover it works where the phpMyAdmin fails and it is much faster then phpMyAdmin. Try it.

You may be interested in my Drupal websites and HostGator experience too.

Content: 
TOPlist