473,417 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,417 software developers and data experts.

Postgresql connection problem on SUSE-9.1

I'm running PHP-4.3.4 and Postgresql 7.4.2 on SUSE-9.1. I have this piece of
PHP:

<?php
$c = pg_connect("user=derek dbname=webcalendar");
?>

which produces this error in the browser:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT
authentication failed for user "derek" .
in /home/derek/public_html/misc/testpg.php4 on line 3

And yet, from the command line, it works OK:
psql -U derek -d webcalendar

Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

webcalendar=# \dt
List of relations
Schema | Name | Type | Owner
--------+--------------------------+-------+-------
public | webcal_asst | table | derek
public | webcal_categories | table | derek
public | webcal_config | table | derek
....

There is no password to access this DB, but adding password='' to the
connection string didn't help. The postgresql error log contains the
message: '2004-10-18 13:47:26 FATAL: IDENT authentication failed for user
"derek"'.

Can anyone tell me what I'm doing wrong?
Jul 17 '05 #1
2 2889
Derek Fountain wrote:
I'm running PHP-4.3.4 and Postgresql 7.4.2 on SUSE-9.1. I have this piece of
PHP:

<?php
$c = pg_connect("user=derek dbname=webcalendar");
?>

which produces this error in the browser:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT
authentication failed for user "derek" .
in /home/derek/public_html/misc/testpg.php4 on line 3

And yet, from the command line, it works OK:

psql -U derek -d webcalendar


Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

webcalendar=# \dt
List of relations
Schema | Name | Type | Owner
--------+--------------------------+-------+-------
public | webcal_asst | table | derek
public | webcal_categories | table | derek
public | webcal_config | table | derek
...

There is no password to access this DB, but adding password='' to the
connection string didn't help. The postgresql error log contains the
message: '2004-10-18 13:47:26 FATAL: IDENT authentication failed for user
"derek"'.

Can anyone tell me what I'm doing wrong?

try adding host=localhost to the connect string. This forces the use of
tcp/ip connections. It *might* work (:

Steve
Jul 17 '05 #2
ljb
no****@example.com wrote:
I'm running PHP-4.3.4 and Postgresql 7.4.2 on SUSE-9.1. I have this piece of
PHP:

<?php
$c = pg_connect("user=derek dbname=webcalendar");
?>

which produces this error in the browser:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT
authentication failed for user "derek" .
in /home/derek/public_html/misc/testpg.php4 on line 3

And yet, from the command line, it works OK:
psql -U derek -d webcalendar


I think: your PostgreSQL pg_hba.conf is set to use "ident" authentication,
where the ident protocol is used to verify the identity of the connection.
When running through the web server, the web server's user ID (something
like "nobody", usually) is returned, which does not match your claimed
username (user=derek). From command line, you are probably logged in as
yourself so ident verifies it is you.

Consider switching from ident to password-based (md5) authentication and
supplying passwords when connecting. If you stick with ident, you probably
need a database account for the web server's username.
Jul 17 '05 #3

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

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
7
by: Peter Eisentraut | last post by:
SuSE RPMs for PostgreSQL 7.4 are available at ftp://ftp.postgresql.org/pub/binary/v7.4/suse or a mirror http://www.postgresql.org/mirrors-www.html or at
0
by: Jordan S. Jones | last post by:
All, Is anyone else having issues installing the SuSE PostgreSQL 7.4 RPMS that was announced on the list the other day? Every time I attempt to build the srpm or install the -server rpm I get a...
13
by: Zlatko Matić | last post by:
Is it possible to use Access as front-end for POstgreSQL and how ? What about Access Projects (.adp) and PostgreSQL ?
4
by: Phil Campaigne | last post by:
Hello, I originally installed postgresql as root user and now I am setting up a development environment with cvs and a java ide and tomcat. I have everything with the exception of postgresql...
0
by: John Pawlicki | last post by:
I did a new install of SuSE 9.1 and had SuSE do the install via it's rpm packages install postgresql 7.4.2. I did a pg_dump prior to this and a restore after the new install. The database is fine....
0
by: Tamer | last post by:
Hi! I want to compile my Jabber Server and connect it with the latest PostgreSQL Server. I installed all packages from the mirror server available for SuSE Linux 9.0 but the ./configure script...
9
by: Andy B | last post by:
If I bought one of these boxes/OS combos as a postgresql database server, would postgresql be able to make the best use of it with a huge (e.g. 40GB) database? Box: HP ProLiant DL585, with ...
2
by: SmoothJazz | last post by:
Hi All! I am wanting to setup/run PostgreSQL on my server (a SuSE Linux 9.2 distro) but I'm not quite sure which way to go. I have a few books on PostgreSQL but they don't seem to match the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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...
0
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
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...
0
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...

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.