Rajeeb binRazaq
Rajeeb binRazaq

Reputation: 31

Cannot connect postgresql database through pgadmin 3

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!!

Upvotes: 0

Views: 1605

Answers (2)

Rajeeb binRazaq
Rajeeb binRazaq

Reputation: 31

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

Upvotes: 0

chao_chang
chao_chang

Reputation: 778

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

Upvotes: 1

Related Questions