Importing and Exporting MySQL Databases from the Command Line
Submitted by oli on Sat, 26/06/2010 - 22:13
If you need to constantly move databases around between different MySQL servers the quickest way to do it is to dump the contents into a SQL file on the command line then GZIP it and send it to another server via SCP or FTP.
To export a database use the following command:mysqldump -u username -p dbname > dbname.sql
To import it on the destination server use the following command:mysql -u username -p dbname < dbname.sql