how to dump sql.gz file in to mysql how to dump sql.gz file in to mysql linux linux

how to dump sql.gz file in to mysql


You should tell gunzip to write to standard out. What you are doing right now is not going to pipe any output at all.

gunzip -c dbdump.sql.gz | mysql (args...)


I know this is ridiculous, but it was gzipped twice, so

  1. Extract filename.sql.gz
  2. Rename extracted file from filename.sql to filename.gz
  3. Extract again

Hope it will work


We can achieve the same with the below command as well. Here i am using gzip

gzip -d < dbdump.sql.gz | mysql (args..)

Another way is as given below

gzip -c dbdump.sql.gz | mysql (args..)