This trick will show you how to quickly perform a MySQL backup. So let’s dump all the contents of your databases and compress them to be more portable.
mysqldump -u root -p –all-databases | gzip > myDatabases.sql.gz
If you now want to dump this data to another server, simply type:
gunzip < myDatabases.sql.gz | mysql -u root -p
Reference:
Mysqldump manual
Tags: MySQL