From: | Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com> |
---|---|
To: | mmcgillick(at)attbi(dot)com, pgsql-php(at)postgresql(dot)org |
Subject: | Re: Help in connecting to a database with PHP |
Date: | 2002-05-27 08:55:52 |
Message-ID: | 20020527085552.72299.qmail@web20408.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-php |
Hi:
--- "Michael J. McGillick" <mmcgillick(at)attbi(dot)com>
wrote:
> Hi:
>
>
>
> I'm trying to learn how to set up a .php file to
> connect to my
> PostgreSQL database. From the command line, I can
> connect, open and work
> in the database on my machine. However, if I create
> a .php page with the
> following information:
>
>
>
> $db = pg_connect("dbname=baseball
> user=postgres");
>
>
>
> I get the following error message:
>
>
>
> Warning: Unable to connect to PostgreSQL server:
> FATAL 1: IDENT
> authentication failed for user "postgres" in
> /var/www/html/baseball.php
> on line 10.
Try checking the file "pg_hba.conf" ( Usually in
/usr/local/pgsql/data). It seems that your connection
requires a password. try to set the "auth_type" to
"trust" in "pg_hba.conf" to skip password check or use
"pg_connect(dbname=baseball user=postgres
password=<password of the user account "postgres");"
Hope that helps.
ludwig.
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Eckhard Hoeffner | 2002-05-27 09:30:36 | Re: Help in connecting to a database with PHP |
Previous Message | Michael J. McGillick | 2002-05-27 06:07:20 | Help in connecting to a database with PHP |