One of the nightmares for web developers (at least it’s one of mine) is finding yourself needing to upload a very large SQL dump to a server without remote access to the MySQL server or shell access—meaning the “only” way is to use PhpMyAdmin.
I put only in quotes because there are certainly many more alternatives, some very manual, and some more convenient like the one I’m suggesting: Bigdump
Bigdump is a small php script that, once configured with your database credentials, takes care of splitting the SQL files you upload to insert them “little by little” into the database, even on servers with limitations like safe_mode.
Its use is very simple:
-
In the downloaded bigdump.php file, configure the database connection details. It’s important not to forget to also modify the encoding to avoid character issues, as it uses latin1 by default.
-
Upload bigdump.php to the server where you need to perform the “problematic” import.
-
Upload the .sql file to be imported to the same directory (you can upload it compressed with gz). If the directory has write permissions, it will offer the option to upload the file directly from a form, although I don’t recommend this option since we are talking about very large files.
-
Run the bigdump.php file from your browser, for example
http://www.tuweb.com/bigdump.php -
Choose the file to import, and the import process will begin without you having to worry about anything else. However, you cannot close the browser window while the import is running.
-
VERY IMPORTANT!!! For obvious security reasons, delete the bigdump.php file and the .sql or .gz files you uploaded once finished.
Download BigDump ver. 0.34b (beta) directly from its creator’s website.
Sergio Carracedo