Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I'd like to use mysqldump with the -T function and somehow compress it in one step, to save writing the uncompressed files to disk (it's a really big database).

mysqldump -T/directory databasename 

This would just write all the files to /directory, but I'd like to send it directly into a .tar.gz archive. Any idea how?

share|improve this question
up vote 2 down vote accepted

this isn't possible. using the -T option causes the mysqld server process (not the mysqldump process) to write to the specified directory. therefore, there's no stream to redirect through tar and gzip.

any particular reason you need tab delimited files?

share|improve this answer
We're using them for possible import into another type of database later on. – Mike Aug 17 '12 at 18:15
ok then, not possible. you'll either have to come up with a completely different solution, or live with compressing the files after the fact. – longneck Aug 17 '12 at 18:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.