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 DUMP_FILE.sql.zip | 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

Get In Touch

We would love to hear from you.

Please enter your email address.
Please enter a valid email address.
Please enter the verification number.
You have entered a wrong verification number.
Please enter a message.
Please check your message for any errors.
Your message has been sent successfully.
Sorry, error occured this time sending your message.
* required