我已经在我的机器上安装了 Postgres,我正在尝试使用Perl
.
$database = "heatmap";
$user = "postgres";
$password = "<password>";
#connect to Postgres database
my $db = DBI->connect(
"DBI:Pg:database=$db;",
$user,
$password
) or die "Can't Connect to database: $DBI::errstr\n";
但是,我收到以下错误:
DBI connect('database=;','postgres',...) failed: FATAL: password authentication failed for user "souzamor" at C:/Users/souzamor/workspace/Parser/Parser.pl line 13.
Can't Connect to database: FATAL: password authentication failed for user "souzamor"
souzamor
是我的 Windows 用户名。但是,我正在尝试以postgres
. 我继续创建了一个名为souzamor
Postgres 的用户,但我得到了:
DBI connect('database=;','souzamor',...) failed: FATAL: database "user='souzamor'" does not exist at C:/Users/souzamor/workspace/Parser/Parser.pl line 13.
Can't Connect to database: FATAL: database "user='souzamor'" does not exist
我对 Postgres 完全陌生。有任何想法吗?谢谢