mysqldump to another host using ssh

Sometimes you will find yourself on a machine without space to dump the database locally, you can get around this limitation using mysqldump piped over ssh.

mysqldump -uuser -ppass -hhostname database | gzip -c | ssh user@host 'cat > ~/dump.sql.gz'