Re: Ident authentication failed for user

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Ident authentication failed for user
Date: 2012-03-01 17:25:58
Message-ID: 4F4FB126.3050903@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 03/01/12 9:02 AM, Ruben Blanco wrote:
> I cannot connect to my Postgres database from my PHP scripts. I get the error:
>
> PHP Warning: pg_connect(): Unable to connect to PostgreSQL server:
> FATAL: Ident authentication failed for user "postgres" in ...
>
>
> I have tried many combinations for "host" TYPE in "pg_hba.conf"
> (restarting postmaster) without success:
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local all all ident
>
> ...
> #host all all * trust
> host all all 127.0.0.1 255.255.255.255 trust
> #host all all localhost trust
> host all all ::1/128 trust
>
>
> Isn't the las record the less restrictive configuration for "host" connections?

specify host=localhost, otherwise its using the first 'local' line,
which specifies 'ident' authentication, as the error implies.

you do realize, trust lets any process on the localhost authenticate as
any user, including the postgres DBA account?

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ruben Blanco 2012-03-01 18:03:29 Re: Ident authentication failed for user
Previous Message Adam Bruss 2012-03-01 17:20:48 Re: accumulating handles problem on machine running postgresql