Re: login error - Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "kamik"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jaromír Kamler <kamler(at)centrum(dot)cz>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: login error - Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "kamik"
Date: 2010-11-12 21:07:39
Message-ID: 2315.1289596059@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

=?UTF-8?B?SmFyb23DrXIgS2FtbGVy?= <kamler(at)centrum(dot)cz> writes:
> But web browser writes this error:
> Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "***" FATAL: password authentication failed for user "***" in /var/www/test/index.php on line 6 Warning: pg_last_error(): No PostgreSQL link opened yet in /var/www/test/index.php on line 7 Could not connect:

What it looks like is your script isn't supplying the right password.

> When I delete in PHP script in pg_connect host="localhost", then all
> works fine, because I use UNIX domain socket (I am thinging ...),

You've got auth method set to "trust" for local connections, so in that
case it's not going to matter whether the script has the right password.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Leon Starr 2010-11-12 21:16:59 How to properly SET NULL on a delete with two attributes referenced?
Previous Message Jaromír Kamler 2010-11-12 21:02:37 login error - Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "kamik"