Re: pg_hba.conf file

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: hodges(at)xprt(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_hba.conf file
Date: 2002-12-05 06:51:22
Message-ID: 1039071082.7970.1037.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2002-12-05 at 03:29, hodges(at)xprt(dot)net wrote:
> I am getting this error trying to connect with
>
>
> Warning: pg_connect() unable to connect to PostgreSQL server: FATAL 1: No
> pg_hba.conf entry for host
> 127.0.0.1, user apache, database tom in /var/www/html/testphp.php on line 3
> connection failed!

You need a line like this (for 7.2.3 and earlier):

host all 127.0.0.1 255.255.255.255 ident sameuser

for 7.3:

host all all 127.0.0.1 255.255.255.255 ident sameuser

(assuming you have a database user called 'apache' and are running an
ident server on that machine; if not, you need a different
authentication method instead of 'ident sameuser'.)

You need to make sure that this comes before any other host line that
would reject the connection.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Go ye therefore, and teach all nations, baptizing them
in the name of the Father, and of the Son, and of the
Holy Ghost; Teaching them to observe all things
whatsoever I have commanded you; and, lo, I am with
you alway, even unto the end of the world. Amen."
Matthew 28:19,20

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message douggorley 2002-12-05 07:05:00 Problem starting the postmaster
Previous Message Dmitri Touretsky 2002-12-05 06:13:46 Re: Yet one more stupid question