Re: Connecting PostgreSQL db using Pear

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: Devrim GUNDUZ <devrim(at)oper(dot)metu(dot)edu(dot)tr>
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Connecting PostgreSQL db using Pear
Date: 2002-10-02 01:50:16
Message-ID: 1033523415.20483.62.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

On Tue, 2002-10-01 at 04:59, Devrim GUNDUZ wrote:
> Hi all,
>
> I've been trying to connect to a local PostgreSQL server using Pear, but I
> could not succeed:
>
> Here is the connect string:
>
> $dsn = "pgsql://$username:$password(at)tcp($hostname:$port)/$dbname";
>
> And all the variables seems to be ok when I print $dsn.
>
> However, I get the following error:
>
> "DB Error: connect failed"
>
> What should I do to correct this?

Can you confirm that the postmaster is started with support for TCP
connections? It is possible that in other instances you are connecting
via unix sockets.

I haven't used PEAR myself, but that seems like one possible problem
with the sort of connect string above.

More information might mean others could provide more help.

Cheers,
Andrew.
--
---------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Survey for free with http://survey.net.nz/
---------------------------------------------------------------------

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Zhidian Du 2002-10-02 02:26:04 Where find a demo/example of one-many input web address?
Previous Message Keary Suska 2002-10-01 22:48:09 Re: Inserting Null Value or String Value