MySQL Dump to tar.gz from remote without shell access MySQL Dump to tar.gz from remote without shell access shell shell

MySQL Dump to tar.gz from remote without shell access


If you are issuing the above command in client side, your compression is done in client side. mysqldump connects the remote server and downloads the data without any compression.

mysqldump -u $MyUSER -h $MyHOST -p$MyPASS $db > filenametar cfz filename.tar.gz filenamerm filename

Probably some unix gurus will have a one liner to do it.


No. The files (yes, plural, since tar is usually used for more than one file) are first placed in a tar archive, and then that is compressed. If you are trying to use the tar command line tool then you will need to save the result in a temporary file and then tar that.

Personally though, I'd rather hit the other side with a cluebat.


mysqldump -u $MyUSER -h $MyHOST -p$MyPASS $db | tar -zcvf $FILE -

Where $FILE is your filename.tar.gz