Re: No connection could be made because the target machine actively refused it

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: No connection could be made because the target machine actively refused it
Date: 2009-04-28 10:57:15
Message-ID: gt6neb$j17$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-04-22, Bill Todd <pg(at)dbginc(dot)com> wrote:
> I am trying to connect to a PostgreSQL server from another machine on my
> small home network. When I click the Test button in the ODBC data mnager
> for my system DSN I get the error "No connection could be made because
> the target machine actively refused it." That may not be the exact
> message but it is close.

You mention ODBC so I'm going to assUme both PCs are running windows.

> I have no problem connecting using localhost on the machine where
> PostgresSQL is running. However, if I connect using the machine's IP
> address (10.0.0.9) either locally or from another PC I get the error
> above. I have disabled the Windows firewall and my antivirus software
> but the error persists.
>
> Any suggestions? I am new to PostgreSQL so assume I have done something
> really dumb.<g>

upto three things..

1: open port 5432/TCP in any firewalls

2: in postgresql.conf file it should not say 'listen addresses="localhost"'
listen_addresses="*" is good unless your server doubles as a firewall/router
in which case you probably want to list the lan interfaces (and localhost).

3: you may need to modify pg_hba.conf too.

at work we wrap the postgresql MSI installer with our own NSIS installer and
optionally (attempt to) do those tweaks

these conf files are in the postgres "data" directory on windows
machines, there may be a link in your start menu for editing them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Developer 2009-04-28 11:34:00 postgres only in local socket
Previous Message Daniel Migowski 2009-04-28 10:19:19 Re: PostgreSQL Hibernate Problem