Unix Technical Forum

Unable to run psql

This is a discussion on Unable to run psql within the pgsql Admins forums, part of the PostgreSQL category; --> Hello, I am trying to setup a database for an app that requires postresql. My system is running CentOS ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 06:11 AM
Thomas E Dukes
 
Posts: n/a
Default Unable to run psql

Hello,

I am trying to setup a database for an app that requires postresql. My
system is running CentOS 4.1 using postgres 7.4.8. I have never used
postgresql before. I have worked on this most of today and about to delete
it from my harddrive.

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.

I'm as lost as I was at 8:00 this morning.

Any help would be greatly appreciated!!



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 06:11 AM
Jeff Frost
 
Posts: n/a
Default Re: Unable to run psql

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/i...ntication.html

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:05 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com