Import/export zipped/gzipped MySQL dumps

You can pipe a zip that contails a single sql file into mysql using -p flag with unzip.

unzip -p | mysql -u MYSQL_USER -p DB_NAME

Import/export MySQL using Gzip

Importing gzipped sql file into mysql

gunzip < DUMP_FILE.sql.gz | mysql -u MYSQL_USER -p DB_NAME

Use this for backing up MySQL to a gzip archive

mysqldump -u MYSQL_USER -p DB_NAME | gzip -9 > DUMP_FILE.sql.gz

NOTE: Make sure the zip/gzip archive file contains only a single sql file. Make sure to change DB_NAME to the name of your database on the MySQL server.

Import using SQL file 

mysql -u MYSQL_USER -p DB_NAME < DUMP_FILE.sql


Visit sunny St. George, Utah, USA