subscribe via rss subscribe via mail subscribe via twitter

How To Upload a Big SQL File To MySQL

Posted in Databases, February 2nd, 2010 and has 4 comments

by AndrewGoldenberg.ca @flickr

Recently, I wanted to upload a 10GB SQL file to MySQL using PhpMyAdmin. unfortunately, it didn’t work properly. the fields were created in the database but with no records. It seemed to be a memory and PHP configuration issue. After that i made some searches. And eventually, figured out that there is a script called BigDump is made for this purpose.

To restore the very large backup of your mySQL database (or a part of it) into the new or the same mySQL database. You can’t access the server shell and you can’t import the dump using phpMyAdmin or any other scripts due to hard memory resp. runtime limit of the web server. -ozerov.de/bigdump.php

alright, so now all what you gotta do is to follow these steps:

  • Download the script (10 KB ZIP archive).
  • open BigDump.php with any text editor. Edit your MySQL connection information.
$db_server   = '';
$db_name     = '';
$db_username = '';
$db_password = '';
  • Upload the script (bigdump.php) to your server.
  • Upload the SQL (.sql) file to your server.
  • Go to http://www.mywebsite.com/bigdump.php and from there you can start the process.
  • bigdump

  • Click on Start Import and you are done! Congrats.

For more information and detailed steps, you can visit BigDump homepage.

Author

Mohamed Amine is a university student. He lives in Algeria, Algiers. He is interested in PHP, jQuery, and Css. He likes to play Bowling and Pool. You can follow him on Twitter and Facebook.

What's next? Help us to share this.

Comments

Want to show an avatar next to your comments? Join Gravatar.
  • Casey said:

    Just wanted to let you know that this isn’t always a PHP issue. We discovered on my one project that some browsers can only upload files up to 2GB in size.

  • @Casey
    Thanks! It is always great to know these information.

  • Aaron said:

    A brilliant post and very helpful as I was migrating a large SQL database between hosts @GoDaddy and @DreamHost.

    Thank you Thank you

    Worked like a charm!

  • Philip said:

    Thanks, I was having trouble importing a large SQL file, this post sorted my problem.

Follow Discussion

Leave a Reply