473,480 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

php -postgresql

Jay
hi people,
i have been trying to connect to the database using php. but i am not
able to do so .i am getting the following errors


*Warning*: pg_connect(): Unable to connect to PostgreSQL server:
FATAL: IDENT authentication failed for user "jay" . in
*/var/www/proj/psql_results.php* on line *37*

on using the following command
$connection = pg_connect("host=localhost dbname=cs542 user=jay") or
die("could not connect");

can anyone tell me where am i going wrong.
help would be greatly appreciated
thanks
jay
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
4 1380
*Warning*: pg_connect(): Unable to connect to PostgreSQL server:
FATAL: IDENT authentication failed for user "jay" . in
*/var/www/proj/psql_results.php* on line *37*

on using the following command
$connection = pg_connect("host=localhost dbname=cs542 user=jay") or
die("could not connect");


check out $PGDATA/pg_hba.conf

bye, chris
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2
El Mié 28 Jul 2004 15:12, Jay escribió:
hi people,
i have been trying to connect to the database using php. but i am not
able to do so .i am getting the following errors


*Warning*: pg_connect(): Unable to connect to PostgreSQL server:
FATAL: IDENT authentication failed for user "jay" . in
*/var/www/proj/psql_results.php* on line *37*


The error message is quite obvious. You have an authentication problem.

First, you are not sending the password, and it looks like you are using the
ident method to autenticate, so jay should authenticate againt the ident
server.

You should take a good look at pg_hba.conf before you continue with the
coding.

--
16:05:01 up 23 days, 7:42, 1 user, load average: 1.86, 0.97, 0.57
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3
Jay,

J> hi people,
J> i have been trying to connect to the database using php. but i am not
J> able to do so .i am getting the following errors

You won't get in as user "Jay" on the default access settings. Unless
you change the settings, Postgres expects to the system user to have
the same username as the Postgres user. So the path of least
resistance is to set up a Postgres user with the same name as Apache
has on your system, and use that as the username in pg_connect().

------------------
Geoff Caplan
Vario Software Ltd
(+44) 121-515 1154
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4
On Wed, 2004-07-28 at 14:08, Geoff Caplan wrote:
Jay,

J> hi people,
J> i have been trying to connect to the database using php. but i am not
J> able to do so .i am getting the following errors

You won't get in as user "Jay" on the default access settings. Unless
you change the settings, Postgres expects to the system user to have
the same username as the Postgres user. So the path of least
resistance is to set up a Postgres user with the same name as Apache
has on your system, and use that as the username in pg_connect().


Actually, with ident turned on, you shouldn't need to have a user listed
in pg_connect, or a password.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2146
by: Otis Green | last post by:
Vote for or against a new newsgroup proposal. To summarize what you need to do, just send an empty e-mail to postgresql-ballot@netagw.com You will receive a ballot by e-mail. Follow the...
1
2809
by: Mateusz [PEYN] Adamus | last post by:
Hi I'm a developer currently wondering which DB choose for my next project. I looked on the net found ofcourse Oracle but also came up with PostgreSQL. I heard quite few things about it, all...
0
3826
by: Bill J. | last post by:
I have to update a PostgreSQL linked server through MSSQL2K. I first configured the connection with ODBC as follows and I can do queries with no problem: EXEC sp_droplinkedsrvlogin @rmtsrvname...
0
2165
by: Bill J. | last post by:
I have to update a PostgreSQL linked server through MSSQL2K. I first configured the connection with ODBC as follows and I can do queries with no problem: EXEC sp_droplinkedsrvlogin @rmtsrvname...
33
5504
by: Joshua D. Drake | last post by:
Hello, I think the below just about says it all: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg Sincerely, Joshua Drake
20
1509
by: John Wells | last post by:
Yes, I know you've seen the above subject before, so please be gentle with the flamethrowers. I'm preparing to enter a discussion with management at my company regarding going forward as either...
0
1642
by: ruhunu Gamarala | last post by:
Hi, I get the following exception periodically. does anybody what is the reason for it to throw this exception? I really appriciate if anyone can help me on this. thanks, Chinthaka at...
0
1820
by: greg | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is a PGP-signed copy of the checksums for PostgreSQL version 7.4. The latest copy of the checksums for this and other versions, as well...
1
1110
by: phil campaigne | last post by:
On Mon, 1 Mar 2004, phil campaigne wrote: >> Nigel J. Andrews wrote: >> > > >>> >On Mon, 1 Mar 2004, Phil Campaigne wrote: >>> > >>> >
0
1623
by: Greg Sabino Mullane | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is a PGP-signed copy of the checksums for following PostgreSQL versions: 7.4.5 7.4.4 7.3.7
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7060
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4501
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3013
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3004
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.