OperationalError: could not connect to server. Error while launching odoo

OperationalError: could not connect to server. Error while launching odoo

我在尝试 运行 odoo 10 时遇到此错误:

OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

为了帮助其他面临同样问题的人,我按照以下步骤解决了这个问题 首先,我杀死了所有 运行 个进程

ps ax | grep odoo

sudo kill -9 (process_id)

然后我检查了 postgresql 状态并重新启动了 postgresql。

sudo /etc/init.d/postgresql status

sudo /etc/init.d/postgresql restart

问题已成功解决!