January 25, 2005

MySQL | Compressing mysqldump output on the fly

The mysqldump utility doesn't provide any inbuilt facilities for compressing output. This can be a problem if the disk space available is smaller than the dump's final size. On Linux and UNIX systems the way round this is to compress mysqldump's output on the fly, e.g. using the bzip2 utility:

mysqldump -uroot -pPASSWORD --opt --all-databases | bzip2 -c > mysql-full-dump.bz2
Posted at 10:23 PM