Since mysqldump sends its output to the console, we can pipe the output through gzip or bzip2 and send the compressed dump to the backup file. Here’s how you would do that with bzip2 and gzip respectively.

mysqldump –all-databases | bzip2 -c >databasebackup.sql.bz2

mysqldump –all-databases | gzip >databasebackup.sql.gz

Post By Editor (2,827 Posts)

Website: →

Connect