16 Feb 2011 @ 1:29 PM 

Pretty straightforward

To compress mysqldump output :

mysqldump -uroot -psome_password db_name| gzip -c > db_name.gz

or alternatively, to compress it to a file on another host

mysqldump -uroot -psome_password dbname | gzip -c | ssh user@host -p22 'cat > /root/db_name.sql.gz'

To restore a database from a compressed file

gunzip < db_name.gz | mysql -uroot -psome_password db_name
Posted By: Zayin
Last Edit: 18 Feb 2011 @ 09:34 AM

EmailPermalink
Tags
Categories: linux, mysql


 

Responses to this post » (6 Total)

 
  1. zayinkrige says:

    New Blog Post -> Gzip mysqldump output and gunzip it for import – http://www.zayinkrige.com/gzip-mysqldump

  2. Yossi says:

    That’s awesome, thanks !

  3. [...] source: http://www.zayinkrige.com/gzip-mysqldump-output-and-gunzip-it-for-import/ [...]

  4. Bala says:

    Thank u so much…… it is very usefull…..:)

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.


 Last 50 Posts
 Back
Change Theme...
  • Users » 1
  • Posts/Pages » 40
  • Comments » 64
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Links



    No Child Pages.

Portfolio



    No Child Pages.