postgresql 用户“odoo”的对等身份验证失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37193143/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Peer authentication failed for user "odoo"
提问by Nero Ouali
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"".
我在使用 Odoo 9,我在使用 odoo 服务器时遇到问题$odoo.py -r odoo -w password
,localhost:8069
没有加载,我在终端上收到错误“用户“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).
我已经在 postgres 上创建了一个用户“odoo”。
午餐时,$odoo.py
我可以在浏览器上加载 odoo 页面,但无法创建数据库(作为默认用户)。
It was working and i already created database but when I logged out I couldn't connect to my database account anymore.
它正在工作,我已经创建了数据库,但是当我注销时,我无法再连接到我的数据库帐户。
Any ideas ?
有任何想法吗 ?
回答by lsilva
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.
您需要更改 pg_hba.conf 配置。这个错误意味着您正在使用对等身份验证,因此您需要将其更改为 md5 或适合您的内容。
You can find more information here: http://www.postgresql.org/docs/9.4/static/auth-pg-hba-conf.html
您可以在此处找到更多信息: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
本地所有所有 md5
回答by Giezel Esteves
This helped me.
这对我有帮助。
- sudo nano /etc/postgresql/9.3/main/pg_hba.conf
- 须藤纳米 /etc/postgresql/9.3/main/pg_hba.conf
then add
然后加
- local all odoo trust
- 本地所有 odoo 信任
then restart postgres
然后重启postgres
- sudo service postgresql restart
- 须藤服务 postgresql 重启
回答by wahab ali
I know this is an old post but upper results are not working for me.Well this will definitely work. You can see this django link.
我知道这是一个旧帖子,但上面的结果对我不起作用。好吧,这肯定会起作用。你可以看到这个 django链接。
Apparently there are multiple ways for authentication with postgresql.
显然有多种方式可以使用 postgresql 进行身份验证。
So,if your Postgresql user is different from your linux user then one easy way is to add --db_host
to localhost
which is "127.0.0.1"
:
因此,如果您的 Postgresql 用户与您的 linux 用户不同,那么一种简单的方法是添加--db_host
到localhost
其中"127.0.0.1"
:
.odoo-bin -r "pg_user" -w 'pg_pass' --db_host "127.0.0.1"
If you feel any problem in this,Tell me i will elaburate further
如果你觉得这有任何问题,告诉我我会进一步阐述