0

I was trying to connect my database with my credentials through pgadmin3 interface but it shows authentication error. But I can connect that same database and access everything through the terminal with the same credentials.

Is there anyone who got the same situation? How do I get rid of this issue ?? Thanks in advance!!

2
  • What exactly is the error produced? Commented Oct 9, 2018 at 4:51
  • @ultrajohn This is the exact error message produced. An error has occurred: 10:30:43: Error: Error connecting to the server: FATAL: Peer authentication failed for user "odoo" Commented Oct 9, 2018 at 5:01

2 Answers 2

1

Is your database server localhost and you are using the command #sudo -u odoo psql -h localhost to connect to it?

From the error message, it seems that the peer authentication is used for user odoo . In this case, you don't have to set the password. (Password will not be used)

Do you want to keep using peer authentication or use password(md5) authentication?

In the former case, you should start pgadmin as odoo user and leave the Host field blank so that pgadmin connects using the local Unix socket rather than TCP.

In the latter case, you should change the pb_hba.conf like the following to let odoo user use the md5 authentication.

local your-database odoo md5

Sign up to request clarification or add additional context in comments.

Comments

0

I got the solution!

You have to change the pb_hba.conf file and change the lines

local all postgres peer 
local all all peer

to

local all postgres md5
local all all md5

Then restart postgres using sudo service postgresql restart command

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.