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
In reply to Re^4: How do you use Net::OpenSSH to query mysql database via ssh tunnel
by nysus
in thread How do you use Net::OpenSSH to query mysql database via ssh tunnel
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |