Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Pipe gunzip and mysql to gunzip a dump and import it

i have a .gz file of an sql dump. at the moment i extract it to its own file (ie dump.sql.gz extracted to dump.sql) then i import that file, then once its done i delete the file.

how can i just import without having to make / delete the sql file?

(im on unix btw)

share|improve this question

marked as duplicate by Sathya Nov 8 '12 at 9:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

If the import tool can read from a pipe you could use zcat

$> zcat dump.sql.gz | import_tool

share|improve this answer
+1 for k.i.s.s. principle :). note zcat's usually a shellscript that exec's gzip -cd (meaning gzip --stdout --decompress) – quack quixote Oct 28 '09 at 0:49