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

Re: trouble with connection

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: Didier Gasser-Morlay <didiergm(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: trouble with connection
Date: 2009-07-29 10:29:13
Message-ID: 4A702479.7040208@netzmeister-st-pauli.de (view raw or flat)
Thread:
Lists: pgsql-novice
Didier Gasser-Morlay schrieb:
> Hello,
> 
> I am confused with the users configuration:
> 
> I have created a user called webstar; granted it all on one database
> (called webstar).
> I want the user webstar to provide a password
> 
> so I have the following pg_hba.conf
> 
> 
> # "local" is for Unix domain socket connections only
> local   all         webstar                            md5
> local   all         all                                ident sameuser
> # IPv4 local connections:
> host    all         all         127.0.0.1/32           ident sameuser
> # IPv6 local connections:
> host    all         all         ::1/128                ident sameuser
> 
> this work fine from the command line where i can use pgsql with
> 
> pgsql -U webstar -W
> 
> I am prompted for a password and I can connect.
> 
> Now when I try to connect from php I get
> 
> pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident
> authentication failed for user "webstar"
> 
> it clearly says that the user webstar is trying for an ident
> connection, not a password one. and I do not understand why.
> 
> can you enlighten me ?
> 
> thanks in advance
> 
> Didier

I assume you're not running 8.4, because sameuser is deprecated. So ident sameuser means, 
that you have a systemuser called webstar. Does this user exist? If not, add the user with

adduser webstar

and provide a password. Then it should work.

Cheers

Andy


In response to

Responses

pgsql-novice by date

Next:From: Didier Gasser-MorlayDate: 2009-07-29 10:43:59
Subject: Re: trouble with connection
Previous:From: Didier Gasser-MorlayDate: 2009-07-29 09:36:47
Subject: trouble with connection

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