Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to log into my DB and am getting this error...

root@---:~# psql -U user database
psql: FATAL:  Peer authentication failed for user "user"

What does this mean? I'm pretty sure I can fix it by putting peer into my pg_hba.conf but I'm not sure if I should so so...

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

It means that the system attempted peer authentication (…obtaining the client's operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.), and it failed.

Is your pg_hba.conf configured for peer authentication for local connections?
If so you may need to change that to a more appropriate auth method such as md5 or trust(not recommended).
Refer to the Postgres Manual for more information.

share|improve this answer
    
is there a way to restart the database once you change the pg_hba.conf? Have changed everything but still not working –  ovatsug25 Jan 18 '13 at 21:06
    
@ovatsug25 Indeed there is - …If you edit the file on an active system, you will need to signal the postmaster (using pg_ctl reload or kill -HUP) to make it re-read the file. -- If you're going to be adminning a Postgres system you should bookmark the manual (ideally for the version you're running). It's an excellent piece of documentation, and you will be referring to it often. –  voretaq7 Jan 18 '13 at 23:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.