How to use gzip or gunzip with mysqldump/mysql to import/export

You, UnixMySQL

The syntax is fairly easy and it is a common practice to use gzip specially when you transfer your backup files over two or more different servers so here is the syntax.


mysqldump -u user -p database | gzip > database.sql.gz


gunzip < database.sql.gz | mysql -u user -p database
© Heshan Wanigasooriya.RSS

🍪 This site does not track you.