How to Сompress a mysqldump Backup Using Gzip by@adidragocea
5,768 reads

How to Сompress a mysqldump Backup Using Gzip

tldt arrow
EN
Read on Terminal Reader

Too Long; Didn't Read

How to Сompress a mysqldump backup using Gzip? Gzip can be used togheter the size of the output. It has 9 leveles of compression, 6 being the default one. Gzip has a lot of flags & functions. Check out mysq.guru to find out what else you can do with mysqllump.com. You can also use the tool to perform logical backups for your databases. The output is a. SQL file that can be. used later to restore one or more databases.
featured image - How to Сompress a mysqldump Backup Using Gzip
Adrian HackerNoon profile picture

@adidragocea

Adrian

DigitalOcean Backups - Weap.io

Learn More
LEARN MORE ABOUT @ADIDRAGOCEA'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

What is mysqldump?

mysqldump is a tool that allows you to perform logical backups for your MySQL databases. The output of mysqldump is a SQL file that can be used later to restore one or more databases.

How to compress a mysqldump backup using Gzip?

Gzip can be used togheter with mysqldump in order to compress the size of the output. It has 9 leveles of compression, 6 being the default one.

Let's assume we have a database named

my_app
for which we want to create a dump and compress it using gzip (default level of compression). We can achieve it with the following command:

mysqldump my_app | gzip > my_app_backup.sql.gz

How to specify the compression level?

Let's assume we want to backup the same

my_app
database, but this time with a compression level of 8. We can do it with the following command:

mysqldump my_app | gzip -8 > my_app_backup.sql.gz

What else can be done using mysqldump?

mysqldump has a lot of flags & functions. Check out mysqldump.guru to find out what else you can do with mysqldump.

Previously published at https://medium.com/@adidragocea/how-to-compress-a-mysqldump-backup-using-gzip-5dc2a240e9a7

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa