How do I restore a very large database from a dump taken elsewhere?
The best, fastest and most certain way to import a very large database from a dump taken elsewhere is via the command line.
- Create the new empty database with the MySQL management tool.
- FTP the dump file into your web space somewhere
- use the command mysql -u dbusername -pdbpassword database-name < dumpfile.sql
A space between -u and the dbusername
NO space between -p and the dbpassword
You specify which database you are importing into and a left chevron and the name of the dump file.
It's best to do this for the following reasons.
- FTP has no time limit in which to upload the file.
- The command line, unlike a web-server, won't time-out if it takes too long.
We recommend the use of PuTTY to SSH into the command line, however, any decent SSH Client will work.
Please note that mysql imports via command line or web import, are subject to I/O and CPU controls, so that customers importing data do not make the database unavailable for users users.