Importing and exporting a MySQL database via SSH
How to dump and restore databases from the command line.
phpMyAdmin is fine for small databases, but push it too hard and things fall apart — the browser times out, large dumps fail to upload, and you're left staring at an error page. For anything substantial, it's far better to handle imports and exports directly over SSH. It's faster, more reliable, and there are no file size limits to worry about.
Import
mysql -uUSER -pPASSWORD DBNAME < /path/to/DUMPFILE.sql
Note: there's no space between the
-uand-pflags and their values.
Where:
USER— your database username (e.g.u111111_dbuser)PASSWORD— your database passwordDBNAME— the name of the database you're importing into (e.g.u111111_database)/path/to/DUMPFILE.sql— the full path to your dump file
Our products and services
Export
mysqldump -uUSER -pPASSWORD DBNAME > /path/to/DUMPFILE.sql
Same rule applies: no space between
-u,-pand their values.
Where:
USER— your database username (e.g.u111111_dbuser)PASSWORD— your database passwordDBNAME— the name of the database you're exporting (e.g.u111111_database)/path/to/— the directory where the dump file will be savedDUMPFILE.sql— the filename for the exported dump
Help
If you have any questions or need assistance, please contact us through the ticket system — we're always here to help!