MySQL – Restore from Compressed Backup

Copied a compressed database backup from the Production server to the Development server. The database backup file was compressed using bzip2 while piping from mysqldump.

mysqldump -u root -p –databases perfparse | bzip2 -z1 > perfparse.bkp.bz2

bzip2 Options

z = compression
1 = fastest compression (compared to 9 = best compression)

Used bunzip2 to uncompress while piping to mysql due to limited disk space.

bunzip2 < perfparse.bkp.bz2 | mysql -uroot -p

Very basic information, but I do use this blog for referring myself and others back to my notes.

Compressing mysqldump output
bzip2 Home


4 Responses to MySQL – Restore from Compressed Backup

  1. Jeff says:

    Hi Mike,

    Check out HyperBac for MySQL, this does integrated compression and encryption of mysqldump’s without using pipes, it is faster than most algorithms out there (including bzip). The product is available for MySQL on Windows and Linux royalty free. Solutions are also available for Oracle, MSSQL and other platforms, all working with native backup interfaces for the various platforms.



  2. mrothouse says:

    Thanks for the information Jeff. I added the link to the product in your comment. Thanks again for sharing.

  3. Tomek says:

    Cool :) thanks a lot

  4. finance says:

    Hello, after reading this amazing article i am also happy to share
    my experience here with mates.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: