Requires zcat and pv.


Dump remote DB to local machine:

[ssh user] = SSH user name

[remote server] = Server hosting the MySQL DB that you want to dump

[remote mysql user] = MySQL user that has read access to the DB

[remote mysql password] = Password for aforementioned user

[remote db] = Remote DB name

ssh -l [ssh user] [remote server] "mysqldump -u [remote mysql user] --password=[remote mysql password] --single-transaction --quick --lock-tables=false [remote db] | gzip -3 -c" | pv > [remote db].sql.gz

Import local dumped DB to local MySQL instance:

[local db] = Local DB name

[local mysql user] = MySQL user that has write access to the DB

[local mysql password] = Password for aforementioned user

zcat [remote db].sql.gz | pv | mysql -u [local mysql user] --password=[local mysql password] [local db]