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.

References
Compressing mysqldump output
bzip2 Home

About these ads

3 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.

    Regards,

    Jeff

  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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: