How to Import a Large MySQL Database
So you just bought a 400,000 record article database or have a new server and need to migrate your database but it is larger than 30 MB so phpmyadmin won’t let you.
Do not worry. There is a simple system to import your large database. Go get bigdump.php and follow these steps:
- Open bigdump.php in a text editor and adjust the database configuration
- Drop the old tables on the target database if your dump doesn’t contain “DROP TABLE” (use phpMyAdmin)
- Create the working directory (e.g. dump) on your web server
- If you want to upload the dump files directly from the web browser give the scripts writing permissions on the working directory (e.g. make chmod 777 on a Linux based system). You can upload the dump files from the browser up to the size limit set by the current PHP configuration of the web server. Alternatively you can upload any files via FTP.
- Upload bigdump.php and the dump files (*.sql or *.gz) via FTP to the working directory (take care of TEXT mode upload for bigdump.php and dump.sql but BINARY mode for dump.gz if uploading from MS Windows).
- Run the bigdump.php from your browser via URL like http://www.yourdomain.com/dump/bigdump.php. Now you can select the file to be imported from the listing of your working directory.
- BigDump will start every next import session automatically if you enable the JavaScript in your browser.
- Relax and wait for the script to finish. Do not close the browser window!
- IMPORTANT: Remove bigdump.php and your dump files from your server
Want automatic updates? Subscribe to our RSS feed or Get E-mailed Updates!
Posted by Carl Thomas / Affiliate Preacher on September 4th, 2007









Tuesday, June 10th, 2008 at 10:12 am
Excellent tutorial, this was just what I was looking for.
Just bought a new directory site, and needed to upload a 29mb sql file.
Changed the settings, uploaded the bigdump file, and in under 5 minutes the database was created. That saved me a whole lot of time and effort.
This is highly recommended.
Thanks
[Reply]