export

Importing and Exporting MySQL Databases from the Command Line

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

Subscribe to RSS - export