mysqldump | gzip, best combo
Manage gzipped mysql dumps, without the need to extract them.
Backup:
mysqldump -u username -p your_db_name | gzip -9 > your_db_name.sql.gz
Restore:
zcat your_db_name.sql.gz | mysql -u username -p your_db_name
Written by Òscar Casajuana
Related protips
3 Responses
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/24673/profilemac.jpg)
Add --opt --routines and your DUMP will be the best.
over 1 year ago
·
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/18273/avatar-ika.jpg)
This is also nice, if you have many databases and to support backup rotations: http://sourceforge.net/projects/automysqlbackup/
over 1 year ago
·
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/67807/8d0b1790c5980834ecbb537eafa1a385.jpeg)
You may also use --triggers but it's a user decission to use options or not.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mysql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#