473,606 Members | 2,200 Online
Bytes | Software Development & Data Engineering Community
+ 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.ph p* on line *37*

on using the following command
$connection = pg_connect("hos t=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*******@postg resql.org so that your
message can get through to the mailing list cleanly

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

on using the following command
$connection = pg_connect("hos t=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.ph p* 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*******@postg resql.org

Nov 23 '05 #5

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

Similar topics

1
2164
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 instructions and vote. _______________________________________________________________________ FIRST CALL FOR VOTES (of 2)
1
2825
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 good so I'm wondering how really it is. Till now I've been working on MSSQL and Interbase. So PostgreSQL and Oracle are pretty new to me. I would have to learn them from the start there for I have to make a wise decision :D
0
3843
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 = 'PostgreSQL', @locallogin = NULL GO EXEC sp_DropServer 'PostgreSQL' GO
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 = 'PostgreSQL', @locallogin = NULL GO EXEC sp_DropServer 'PostgreSQL' GO
33
5529
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 a MySql shop or a Postgresql shop. It's my opinion that we should be using PG, because of the full ACID support, and the license involved. A consultant my company hired before bringing me in is pushing hard for MySql, citing speed and community...
0
1660
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 org.postgresql.PG_Stream.flush(PG_Stream.java:356) at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159) at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
0
1832
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 as information on how to verify the files you download for yourself, can be found at:
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
1646
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
8015
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8439
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5966
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5465
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1296
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.