Submitted by Jhun Vert on December 29, 2012 - 4:57pm
Unable to import that large MySQL database into phpMyAdmin? There are reasons why you simply can't import your large MySQL database; browser timeout, server timeout, file size limit, and phpMyAdmin limit are the most common. These are real pains that cannot be avoided specially in shared web hosting. But stop pulling hairs, there are many proven ways to import your large database. In this discussion, I will only share two ways in which I have a first hand experience.
Contact your webhost
This is the best way to do this. Upload your backup to one of the directories of your website then ask your webhost to restore it for you. In most cases, this is the only thing you need to do. Most webhost will import your database for free if the amount of time to do it is considerably minimal. You can then check if the the import process was successful by browsing inside phpMyAdmin.
Use BigDump php script
Login to your cPanel and click the mySQL® Databases.
Create New Database
This would be a blank, empty database. Example: database name cpanel23_dbname
Add New User
It is a good practice to have a different user for each database you created, so do not use the existing user, create a new one. Don't forget to take note of your password, make it very strong. I recommend you use the Password Generator for strong password. Example: username cpanel23_usrname, password F8.q~,\$;#TmY.
Add User To Database
Add user cpanel23_usrname to database cpanel23_dbname and give the user All Privileges to the database.
Now that your database container is ready, go to http://www.ozerov.de/bigdump.php and download the zip BigDump file. Extract it to your computer and open the bigdump.php using any code editing tool. I am currently using Notepad++ for editing codes.
Go to line 38 of bigdump.php and supply the following information: \$db_server = 'localhost';
\$db_name = 'cpanel23_dbname';
\$db_username = 'cpanel23_usrname';
\$db_password = 'F8.q~,\$;#TmY';
\$filename = 'example-db-backup.sql.gz';
Note that the supplied values were just taken from the examples above.
Upload bigdump.php and your MySQL database backup to public_html of your website then open bigdump.php with your browser. Example: http://www.example.com/bigdump.php. Follow the onscreen instruction and your done.
A faster way to import your database is via Linux command line. It is easier to do and more relaible. See this post: /blog/romel-verterra/how-backup-and-restore-mysql-database-linux-command-line
Blog posts (unless otherwise specified) licensed under a Creative Commons Licence. All trademarks and copyrights on this page are owned by their respective owners. Blog posts are owned by the individual posters.