mysqldump from remote host

linux, mysql, ssh

Solution

This would dump, compress and stream over ssh into your local file

ssh -l user remoteserver "mysqldump -mysqldumpoptions database | gzip -3 -c" > /localpath/localfile.sql.gz 

Problem

Is it possible to dump a database from a remote host through an ssh connection and have the backup file on my local computer. If so how can this be achieved? I am assuming it will be some combination of piping output from the ssh to the dump or vice versa but cant figure it out.

Original source

Related problems