Nov 10, 2018

How to backup and restore MySQL with compression

Backup:

$ mysqldump  [dbname] | gzip [-9] > backupfile.sql.gz

Restore:

gunzip < [backupfile.sql.gz] | mysql  [dbname]