in reply to Using Net::SSH2 with DBI
Depending on how your network setup actually is, most likely the sanest approach is to create an SSH tunnel and then connect DBI to the local end of that tunnel.
From a quick look through Net::SSH2, it doesn't seem that it readily supports setting up a tunnel. I think you can use the ->tcpip method to forward packets yourself, but that feels like far too much programming.
Personally, I would simply launch ssh -L local:remote:remoteport or however one sets up an ssh tunnel from the command line, and then direct DBI / DBD::mysql to connect to the local port. Most likely this is what HeidiSQL does as well.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Net::SSH2 with DBI
by stevieb (Canon) on Jan 19, 2016 at 19:25 UTC | |
by Corion (Patriarch) on Jan 19, 2016 at 19:28 UTC | |
|
Re^2: Using Net::SSH2 with DBI
by diyaz (Beadle) on Jan 20, 2016 at 19:15 UTC | |
by Corion (Patriarch) on Jan 21, 2016 at 08:52 UTC |