私はこのperlスクリプトを持っています
wrapper.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use DBI;
# input params
my $end;
my $start;
my $url;
my @IP;
my $host = "localhost";
my $dbname = "flows";
my $username;
my $pass;
GetOptions ("s|start=s" => \$start,
"e|end=s" => \$end,
"r|url=s" => \$url,
"ip|iplist=s" => \@IP,
"h|host=s" => \$host,
"db|dbname=s" => \$dbname,
"u|username=s" => \$username,
"p|pass=s" => \$pass);
# connect and send request to database
my $dbh = DBI->connect("DBI:Pg:dbname=".$dbname.";host=".$host, $username, $pass, {'RaiseError' => 1});
私が走るとき
./wrapper.pl -h 10.0.0.3
私は得る:
DBI connect('dbname=flows;host=10.0.0.3','',...) failed: could not connect to server: No route to host
Is the server running on host "10.0.0.3" and accepting
TCP/IP connections on port 5432?
サーバーにpingを実行でき、5432で接続を受け入れる必要があります。ログイン資格情報が正しくないためにこのメッセージが表示されますか?