How to allow PostgreSQL to accept remote connection?

Started by Andre Lopesalmost 16 years ago4 messagesgeneral
Jump to latest
#1Andre Lopes
lopes80andre@gmail.com

Hi,

I have a virtual machine with VMWARE, and I need to connect from outside the
virtual machine to PostgreSQL.

How can I configure the PostgreSQL to accept outside connections?

Best Regards,

In reply to: Andre Lopes (#1)
Re: How to allow PostgreSQL to accept remote connection?

On 24/04/2010 15:58, Andre Lopes wrote:

Hi,

I have a virtual machine with VMWARE, and I need to connect from outside
the virtual machine to PostgreSQL.

How can I configure the PostgreSQL to accept outside connections?

It should be just the same as a "real" machine.... put the IP address of
the VM's network interface in "listen_addresses" in postgresql.conf.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

#3Andre Lopes
lopes80andre@gmail.com
In reply to: Andre Lopes (#1)
Re: How to allow PostgreSQL to accept remote connection?

Thanks for the reply's,

How can I configure pg_hba.conf to accept connections from all IP's

What I have in this file is:

#ipv4
host all all 127.0.0.1/32 md5

#ipv6
host all all ::1/128 md5

What I need to change?

Best Regards,

On Sat, Apr 24, 2010 at 4:15 PM, Fredric Fredricson <
Fredric.Fredricson@bonetmail.com> wrote:

Show quoted text

Raymond O'Donnell wrote:

On 24/04/2010 15:58, Andre Lopes wrote:

Hi,

I have a virtual machine with VMWARE, and I need to connect from outside
the virtual machine to PostgreSQL.

How can I configure the PostgreSQL to accept outside connections?

It should be just the same as a "real" machine.... put the IP address of
the VM's network interface in "listen_addresses" in postgresql.conf.

You will probably also have to edit pg_hba.conf file (chaper 20.1 in the
manual).
/Fredric

Ray.

#4Fredric Fredricson
Fredric.Fredricson@bonetmail.com
In reply to: Andre Lopes (#3)
Re: How to allow PostgreSQL to accept remote connection?

Andre Lopes wrote:

Thanks for the reply's,

How can I configure pg_hba.conf to accept connections from all IP's

What I have in this file is:

#ipv4|host all all 127.0.0.1/32 <http://127.0.0.1/32&gt; md5
#ipv6
||host all all ::1/128 md5|

What I need to change?

||According to
http://www.postgresql.org/docs/8.2/interactive/auth-pg-hba-conf.html you
should add a line
host all all 0.0.0.0/0 md5
/Fredric
PS. When everything else fails, read the manual.

Show quoted text

Best Regards,

On Sat, Apr 24, 2010 at 4:15 PM, Fredric Fredricson
<Fredric.Fredricson@bonetmail.com
<mailto:Fredric.Fredricson@bonetmail.com>> wrote:

Raymond O'Donnell wrote:

On 24/04/2010 15:58, Andre Lopes wrote:

Hi,

I have a virtual machine with VMWARE, and I need to
connect from outside
the virtual machine to PostgreSQL.

How can I configure the PostgreSQL to accept outside
connections?

It should be just the same as a "real" machine.... put the IP
address of
the VM's network interface in "listen_addresses" in
postgresql.conf.

You will probably also have to edit pg_hba.conf file (chaper 20.1
in the manual).
/Fredric

Ray.