---
title: "Back up MySql Database with Compress"  
description: "If your mysql database is very big and you want to compress the output of mysqldump. Just use below command..$ mysqldump -u [username] -p[password] [d"  
author: "Uttam Misra"  
published: 2011-09-23  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/240/back-up-mysql-database-with-compress  
category: "database"  
tags: ["database"]  
reading_time: 1 minute  

---

# Back up MySql Database with Compress

[If your](https://www.mindstick.com/forum/156103/what-will-be-your-approach-if-your-seo-method-doesn-t-work) [mysql database](https://www.mindstick.com/forum/392/how-to-restore-backup-file-in-mysql-database) is very big and you want to compress the [output](https://www.mindstick.com/forum/161319/how-does-the-print-function-handle-output-in-python) of mysqldump. Just use below [command](https://www.mindstick.com/blog/178/synchronous-and-asynchronous-command-execution-in-c-sharp-dot-net)..

##### $ mysqldump -u [username] -p[password] [databasename] | gzip -9 >

##### [backupfile.sql.gz]

If you want to [extract](https://www.mindstick.com/forum/12883/how-to-extract-sub-string-between-two-string-pattern-using-javascript-jquery) the .gz [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp), use the command below:

##### $ gunzip [backupfile.sql.gz]

---

Original Source: https://www.mindstick.com/blog/240/back-up-mysql-database-with-compress

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
