Home: Perl Programming Help: DBI:
Error while connecting to postgres through DBI



arush_pareek
Novice

Jun 8, 2011, 10:26 PM


Views: 13123
Error while connecting to postgres through DBI

$ cat tt.pl
#!/usr/bin/perl

use DBI;

my $dbh = DBI->connect('dbi:Pg:dbname=postgres;host=laddakh','postgres','postgres',{AutoCommit=>1,RaiseError=>1,PrintError=>0});

ERROR ::

$ perl tt.pl
DBI connect('dbname=postgres;host=laddakh','postgres',...) failed: could not connect to server: Connection refused
Is the server running on host "laddakh" and accepting
TCP/IP connections on port 5432? at tt.pl line 5

Here laddakh is the server name where my postgres is installed.


miller
User

Jun 9, 2011, 1:07 AM


Views: 13120
Re: [arush_pareek] Error while connecting to postgres through DBI

Just read your replies on perlmonks: http://www.perlmonks.com/?node_id=908837.

- Miller