3

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)

1 Answers1

4

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

$> zcat dump.sql.gz | import_tool

Nifle
  • 34,203
  • 26
  • 108
  • 137
  • 2
    +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 00:49