Re: Connection issues with pgsql?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As I said in my first post, I tried the following connection strings as
well:
"dbname=thornvalley user=apache password=[passwd]"
"dbname=thornvalley user=apache password=[passwd] host=localhost port=5432"

and had the same results. After messing around with pg_hba.conf (I set local
authentication to 'password' instead of 'ident', I was able to get an error
message /when I used the wrong password/:

Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL
server: FATAL: Password authentication failed for user "apache" . in
/var/www/html/dbtest.php on line 3
error

If I used the correct password, that message would not appear. Furthermore,
when I added the line
echo "$myconn = ".$myconn;
to my script after pg_connect(), I would get:

$myconn = Resource id #2

which suggessts to me that it is successful in connecting to the db server,
but, for some reason PHP is unable to use the connection after that. Like I
said, it's weird. I have no idea why it's doing that.

----- Original Message -----
From: "Dave Brunberg" <DBrunberg@FBLEOPOLD.com>
To: "'Nathaniel Price'" <seoman@thornvalley.com>; <php-db@lists.php.net>
Sent: Friday, March 28, 2003 12:24 PM
Subject: RE:  Connection issues with pgsql?


> I'd suggest building a connection string, explicitly defining the user and
> password.  Maybe it would give you a more descriptive error that way
> ("invalid user", etc.).
>
> The other thing I've done is do something like this:
>
> $database = pg_connect ($conn_string)
> or die ("Help! No connection to the database! Error: " .
> pg_last_error());
>
>
> That may give you some more diagnostic info?
>
> dwb
> > -----Original Message-----
> > From: Nathaniel Price [mailto:seoman@myrealbox.com]
> > Sent: Friday, March 28, 2003 2:05 PM
> > To: php-db@lists.php.net
> > Subject:  Connection issues with pgsql?
[snip]
> > I have
> > tried using
> > other connection strings as well:
> > "dbname=thornvalley user=apache password=[passwd]"
> > "dbname=thornvalley user=apache password=[passwd]
> > host=localhost port=5432"
> >
> > with the same result.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux