in reply to Re^3: How do you use Net::OpenSSH to query mysql database via ssh tunnel
in thread How do you use Net::OpenSSH to query mysql database via ssh tunnel
OK, that helped. So this code works:
UPDATE: I think this is just connecting me to my local database, not the remote one.my $ssh = Net::OpenSSH->new('me@10.0.1.17'); my ($socket, $pid) = $ssh->open_tunnel('10.0.1.17', '3306'); my $dsn = "DBI:mysql:database=calendar;host=127.0.0.1:3306"; my $dbh = DBI->connect($dsn, 'user', 'password');
Many thanks!
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How do you use Net::OpenSSH to query mysql database via ssh tunnel
by Corion (Patriarch) on May 09, 2017 at 13:32 UTC | |
by haukex (Archbishop) on May 09, 2017 at 14:04 UTC |