Skip site navigation (1) Skip section navigation (2)

pg_hba.conf and password authentication problem

From: Si Chen <schen(at)graciousstyle(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_hba.conf and password authentication problem
Date: 2004-12-23 20:28:27
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
I am having a really strange password authentication problem.

I created a user with
$ createuser -W myuser
and a database with
$ createdb mydb

Then, I put in /var/lib/pgsql/data/pg_hba.conf:
host mydb myuser password

Yet whenever I try to login to the database using either JDBC or the 
command line:
$ psql -W mydb -U myuser -h
and enter the correct password (believe me--it was correct!) I get the
psql: FATAL:  Password authentication failed for user "myuser"

Could it be a mis-specified IP or netmask combination?  I have the exact 
same database and user on another server where everything works 
properly.  (I'm trying to set up a backup server.)  On the main server 
where the password authentication works, I have in /etc/hosts  localhost localhost.localdomain
and a
$ /sbin/ifconfig
lo  inet addr:  Mask

On the backup server, I have in /etc/hosts localhost
$ /sbin/ifconfig
lo inet addr:  Mask

The IP addresses themselves have different netmasks of 

Where should I be looking for the source of this problem?  Sorry but I 
couldn't find anything about it in the documentation or online and don't 
even know where to start.

Thanks in advance!

Si Chen

pgsql-admin by date

Next:From: Joshua D. DrakeDate: 2004-12-24 03:07:58
Subject: Re: restore data from DB base?
Previous:From: Tom LaneDate: 2004-12-23 19:00:27
Subject: Re: VACUUMing for 30 minutes

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group