Skip site navigation (1) Skip section navigation (2)

Re: Connecting to PostgreSQL server

From: Michael Wood <esiotrot(at)gmail(dot)com>
To: Daniel Weitzenfeld <dweitzenfeld(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Connecting to PostgreSQL server
Date: 2011-06-30 11:05:29
Message-ID: BANLkTikfydVAH2LOw+U==FNbxkArGii83A@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 30 June 2011 04:07, Daniel Weitzenfeld <dweitzenfeld(at)gmail(dot)com> wrote:
> Hi,
> I have a remote server with PostgreSQL on it.
> When I try to connect via python/pygresql, I get:
>
> pg.InternalError: could not connect to server: Connection refused
>     Is the server running on host "##.##.##.###" and accepting
>     TCP/IP connections on port 5432?
>
> Where I've blanked out my server's ip address for obvious reasons.
>
> I ssh'd to my server and did this to iptables:
>
> iptables -A INPUT -p tcp --dport 5432 -j ACCEPT
>
> restarted iptables, but still no dice.
>
> Any advice?

First answer the question you got when you tried to connect :)  Is
PostgreSQL listening on port 5432 on the external IP address you were
trying to connect to?

The chances are it was either not listening for TCP connections at
all, or only on 127.0.0.1.

Try running "netstat -tln | grep 5432" and see what you get.

-- 
Michael Wood <esiotrot(at)gmail(dot)com>

In response to

pgsql-novice by date

Next:From: markDate: 2011-06-30 13:10:43
Subject: Re: Locking out a user after several failed login attempts
Previous:From: Odd HogstadDate: 2011-06-30 10:01:13
Subject: Re: Order-by and indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group