You will need to authenticate (either with a password or with a pre-shared key).

Once we’re there, we issue the mysqldump command in single quotes on the remote server.

Lastly we exit the quotes (the remote command) and put the contents of the command into a local file on our local drive (we save the file with a .sql extension).

That’s all there is to it. SSH on a Windows 7 machine using Cygwin to get a remote database. Easy eh? Or you could just spend £1,800 and get a Mac and leave out Cygwin entirely!

Optional – gzip compression

If you want to reduce the download size and save space on your local drive, you could zip the output on the remote end before download. We just pipe (|) the output through gzip before download and add a .gz extension to the filename. The whole command would then be: