I'm trying to use plink
on Windows to create a tunnel to a Linux machine and have the dump file end up on the Windows machine. It would appear that this answer would work and is the basis of my question. But trying it out and looking at other answers I find that the dump file is still on the Linux machine. I'm trying this out in my local environment with Windows and Ubuntu 14.04 before moving to production. In Windows 8.1:
plink sam@192.168.0.20 -L 3310:localhost:3306
mysqldump --port=3310 -h localhost -u sam -p --all-databases > outfile.sql
I've tried swapping localhost
in the second with 127.0.0.1
, adding -N
to the tail of the tunnel setup, using one table in the dump command but despite my tunnel, it's as if the first command is ignored. Other answers indicate to add more commands to the script so that I can use pscp
to copy the file. That also means to re-connect to trash this outfile.sql
. Not ideal for getting other dumps on other servers. If that's the case, why use the first command at all?
What am I overlooking? In plink
, the output of the first is to open up the Linux server where I can run the mysqldump
command. But there seems to be ignoring the first command. What do you think?