OperationalError: FATAL: role "...." does not exist

OperationalError: FATAL: role "...." does not exist

我有一台装有 Openerp 7 和 postgresql 的服务器 (Ubuntu 12.4)。 当我 运行 openerp 使用此命令时:

    sudo service openerp start

它有效(我认为它被称为守护进程)。

所以我尝试用可执行文件"directly"执行它:

    sudo service openerp stop
    /usr/bin/python /usr/bin/openerp -c /etc/openerp/openerp-server.conf

一开始出现如下错误 "OperationalError: fe_sendauth: no password supplied**" 所以我编辑了 pg_hba.conf 就像我在这个网站上看到的 http://ujwalafossist.blogspot.com/2015/01/operationalerror-fesendauth-no-password.html

我尝试了很多东西,现在我的 pg_hba.conf 文件是这样的:

所以现在当我 运行

     /usr/bin/python /usr/bin/openerp -c /etc/openerp/openerp-server.conf

并在我的导航器中刷新 openerp 我遇到了错误 也许这是一个提示,但是当我执行命令时,在刷新之前我在终端中看到 但是我不想用 egg 我想用 eggspg


编辑:当我 运行 'sudo su postgres' 时,我进入我的数据库并输入 \du:我有 3 个角色:eggspg、openerp 和 postgres(但没有鸡蛋)。

因此,当我 运行 守护进程运行时;当我直接 运行 命令时,配置文件有 db_user = eggspg

解决方案:必须更改 pg_hba 文件

' # "local" is for Unix domain socket connections only '

' local all all trust '

并使用数据库用户和数据库密码:

python /usr/bin/openerp -c /etc/openerp/openerp-server.conf -r openerp -w mypassword 或者

python /usr/bin/openerp -c /etc/openerp/openerp-server.conf --db_user=openerp --db_password=mypassword