tags:

views:

56

answers:

2

I would like to access my PostgreSQL 8.3 database with the name of an existing user but, when I try, I get a password authentication failure. I am able to access the database by creating a new Postgres user:

postgres createuser -P newusername

So I tried createuser with the existing user name but it said that that user already existed and wouldn't let me create it.

In pga_hba.conf, I have:

host   db_name   all   0.0.0.0/0  md5

and it doesn't complain about the connection - only the password authentication. Is there a way to remotely access the database using an existing user?

A: 

try changing your pg_hba.conf to:

host db_name all 0.0.0.0/0 password

Note usage of password instead of MD5.

Also, if you are trying to connect from the same machine the DB is hosted at, then on you command line try:

$ psql -h IP_ADDRESS_OF_PG_SERVER -u USER -d DB_NAME
Pablo Santa Cruz
Thanks. It didn't make a difference. I'm using the same method for the one that doesn't work as the one that works anyway. So I wouldn't expect md5 vs. password to make a difference.I'm connecting from a remote machine.
Mitch
+1  A: 

Doh. The problem was I was using the wrong password.

Mitch