Re: BUG #2364: DB Error: connect failed ... PHP/PostgreSql

From: Richard Huxton <dev(at)archonet(dot)com>
To: manashi <manashi_130582(at)rediffmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2364: DB Error: connect failed ... PHP/PostgreSql
Date: 2006-04-03 13:16:24
Message-ID: 44312028.100@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

manashi wrote:
> The following bug has been logged online:
>
> Bug reference: 2364
> Logged by: manashi
> Email address: manashi_130582(at)rediffmail(dot)com
> PostgreSQL version: psql (PostgreSQ
> Operating system: Linux
> Description: DB Error: connect failed ... PHP/PostgreSql

This is probably *not* a bug in PostgreSQL, and you'll be able to find
better help at the pgsql-general/pgsql-novice/pgsql-php mailing lists.

However...

> $dsn = "pgsql://$username:$password(at)$hostname/$dbname";
> echo "The DSN : $dsn<br>";
>
> $con = DB::connect($dsn);

> The DSN : pgsql://root:@localhost/sample
> The Connection Object : Object id #2
> Error Number : 1
> The Message : DB Error: connect failed

> i hav tried a lot to find out the error but unable to find it

Well:
1. Are you logging connection attempts on the server-side and what does
it show?
2. Have you tried turning error verbosity up?
3. What does "psql -U root -h localhost sample" do for you?
4. Have you checked your pg_hba.conf file

It's almost certainly an issue with #4 - the pg_hba.conf file.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Huxton 2006-04-03 13:17:56 Re: BUG #2365: can't install
Previous Message Alvaro Herrera 2006-04-03 00:36:47 Re: BUG #2370: 25P02, current transaction is aborted, commands ignored until end of transaction block