Peer authentication failed for user "odoo"

Nero Ouali picture Nero Ouali · May 12, 2016 · Viewed 17.9k times · Source

I'm on Odoo 9, I have an issue when lunching odoo server $odoo.py -r odoo -w password, the localhost:8069 doesn't load and I get an error on terminal "Peer authentication failed for user "odoo"".

I already created a user "odoo" on postgres.
When lunching $odoo.py I can load the odoo page on browser but I can't create database (as default user).

It was working and i already created database but when I logged out I couldn't connect to my database account anymore.

Any ideas ?

Answer

lsilva picture lsilva · May 12, 2016

You need to change your pg_hba.conf configuration. This error means that you are using peer authentication, so you need to change it for md5 or something that suits you.

You can find more information here: http://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html

If you are connecting locally you will need to change the following entrance from

local all all peer

to something like this :

local all all md5