Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

How to Compressing MySQLdump output file

Posted on October 16, 2012 by Syauqi Wiryahasana
The result of mysqldump is a flat text file containing the sql commands used to restore the mysql databases/tables that were dumped. Normally the result of mysqldump is compressed (in regular backups) because the size of the resulted file is normally big and good compression rates are achieved on such text files. To do this manually using gzip we just run: [code lang="bash"]gzip -v outputfile.sql[/code] This quick tip shows how you can run the same thing on the fly with only one command directly compressing the resulted file. This might be useful in situations where space is a problem and the full dump can’t be saved on the available storage directly because of its size. Also this might be useful to not run it in 2 commands and have one compact command (maybe used also in some backup scripts, etc.) [code lang="bash"]mysqldump < mysqldump options> | gzip > outputfile.sql.gz[/code] When restoring from a compressed file we can manually uncompress it first: [code lang="bash"]gunzip -v outputfile.sql.gz[/code] or again we can run in the same command line mysqldump and gunzip: [code lang="bash"]gunzip < outputfile.sql.gz | mysql < mysql options>[/code] Download: mengkompresi-output-mysqldump.ppt
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically