From: | "Epps, Aaron M(dot)" <Epps(dot)Aaron(at)mayo(dot)edu> |
---|---|
To: | "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: Authentication Question |
Date: | 2003-10-28 20:58:06 |
Message-ID: | AFB1612D9C37D21182E0006008A1F6F813D30DC1@excsrv14.mayo.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
There is no hostname specified in the PHP code when it connects to PostgreSQL, so it's using a socket connections then correct? Also, I did SIGHUP the PostgreSQL server after the configuration changes. Here's what the PHP config file looks like that's used to connect to PostgreSQL
$db = array(
"type" => "pgsql",
"host" => "",
"port" => "",
"name" => "issue-tracker",
"user" => "webuser",
"pass" => "password"
);
I wonder if it's trying to authenticate because there's a username and password specified in the pg_connect() function. However, when I remove the username and password I get the following error...
Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "dbname=issue-tracker" . in /var/www/html/issue-tracker/includes/classes/dbi.class.php on line 98 "
Thoughts?
-----Original Message-----
From: scott.marlowe [mailto:scott(dot)marlowe(at)ihs(dot)com]
Sent: Tuesday, October 28, 2003 2:37 PM
To: Tom Lane
Cc: Epps, Aaron M.; 'pgsql-admin(at)postgresql(dot)org'
Subject: Re: [ADMIN] Authentication Question
On Tue, 28 Oct 2003, Tom Lane wrote:
> "Epps, Aaron M." <Epps(dot)Aaron(at)mayo(dot)edu> writes:
> > I've got an authentication questions. I've just setup pg_hba.conf to use "local all all trust" for testing purposes, but when the application I'm using tries to connect to the PostgreSQL Db (Using PHP) I get the following error.
>
> > " Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT authentication failed for user "webuser" . in /var/www/html/issue-tracker/includes/classes/dbi.class.php on line 98 "
>
> > To me, it looks like PostgreSQL is still trying to authenticate,
> > even
> though it should be trusting all local socket connections.
>
> (1) Did you SIGHUP the postmaster after editing the config file?
> ("pg_ctl reload" is the easy way to do this.) If not, it's still
> using whatever setup you had before.
>
> (2) It's fairly likely that PHP will try to connect via TCP/IP even
> for a local server. If so, the relevant pg_hba.conf line will be the
> one for 127.0.0.1, not the "local" line. "local" is for Unix-socket
> connections.
This is correct if you specify a host name:
pg_connect("host=local dbname=db") <- TCP/IP
pg_connect("dbname=db") <- local unix sockets (i.e. no host=)
From | Date | Subject | |
---|---|---|---|
Next Message | Epps, Aaron M. | 2003-10-28 21:24:26 | Re: Authentication Question |
Previous Message | scott.marlowe | 2003-10-28 20:57:44 | Re: Authentication Question |