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

Re: Unable to run psql

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: Thomas E Dukes <edukes(at)alltel(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Unable to run psql
Date: 2005-08-27 23:17:29
Message-ID: Pine.LNX.4.63.0508271610280.32094@discord.dyndns.org (view raw or flat)
Thread:
Lists: pgsql-admin
On Sat, 27 Aug 2005, Thomas E Dukes wrote:

> I added a password for 'postgres' using passwd.  I can login or su as
> 'postgres' but when I run psql and enter the password it fails because the
> password is invalid.
>

Tom, the confusion lies in the difference between the database user postgres 
and the local system user postgres.  Psql, by default, tries to connect with 
the same database username as the local system username, so if I was running 
psql in my local system account jeff, it would use 'jeff' as the database 
username unless I set the PGUSER environment variable or use the -U switch 
psql.  Are you running this as the postgres system user, or trying to run psql 
as root?  If so, it's probably trying to connect as the 'root' database user 
which will not exist unless you have created it.  If you installed the 
postgresql server from RPMs or any of the standard methods I'm aware of, the 
postgres database user will have no password by default.

There is also possibly some problem with the way you are connecting.  I.e. are 
you attempting to connect via the local system or from a remote client?  If 
it's a remote client, you probably need to make some changes to the 
pg_hba.conf and the postgresql.conf as the default security settings are quite 
restrictive.  You can find the documentation on this here:

http://www.postgresql.org/docs/7.4/interactive/client-authentication.html

-- 
Jeff Frost, Owner 	<jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954

In response to

pgsql-admin by date

Next:From: Flávio BritoDate: 2005-08-28 11:49:13
Subject: see all queries incoming
Previous:From: Thomas E DukesDate: 2005-08-27 21:12:16
Subject: Unable to run psql

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