DB-Upload, a database utility(Page 1 out of 1)
What is it?
DB-Upload is a new database utility for MySQL. This utility allows you to upload large .SQL files, that phpMyAdmin cannot handle. This will allow you to restore database backups that are several hundred MB big.
Why not use command line/shell/SSH?
You should use the MySQL command line client and shell access to restore a large database. It's the only way that's 100% reliable. But face it, not all web hosts allow you shell access. In fact, most web hosts won't give you access. If you need to restore a big database what do you do? phpMyAdmin can't handle sql files that are bigger than 5 MB, so you're pretty much screwed. But with DB-Upload, you can upload much bigger databases. During testing, I have uploaded databases of 90 MB and 500 MB. It can probably do larger databases as well.
How does it work?
DB-Upload executes the sql file in parts (of 100 KB), instead of doing it all at once. This way, it doesn't have the timeout problems that most PHP scripts have. In addition, it doesn't have any memory issues, because each part is only 100 KB.
The downside of this is time. It will take a while to upload a decent size database. It took me about 15 minutes to upload a 90 MB database on my localhost. It probably takes longer on a live server.
- Download the utility: db-upload.php
- Upload your .sql file to your server and remember where you uploaded it to (the file path is what you need to know)
- Upload the DB-Upload utility to your server
- Goto http://www.yourserver.com/where/you/stored/db-upload.php
- You'll be presented with a screen where you can enter all the settings. Make sure they're correct!
- Click on 'Upload Database', and off you go. Just keep running it. DON'T close the window.
That's all there is to it.