[英]Odoo container : Database connection failure: could not connect to server: Connection refused (linking odoo with localhost postgres)
I'm trying to run the odoo docker container and linking it with my local (not container) postgresql.我正在尝试运行 odoo docker 容器并将其与我的本地(非容器)postgresql 链接。
I tried this command (as suggest here ).我试过这个命令(如建议here )。
docker container run -p 8089:8069 -e HOST=127.0.0.1 -e USER=tux -e PASSWORD=tux --name odoo -t odoo
Ran it and got these errors :运行它并得到这些错误:
Database connection failure: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
I tried to open up the port 5432 with ufw but got the same erros.我试图用 ufw 打开端口 5432 但得到了同样的错误。 I also tried to change 127.0.0.1 to 0.0.0.0 but nothing.
我也尝试将 127.0.0.1 更改为 0.0.0.0 但什么也没有。
Could you help me?你可以帮帮我吗?
ps : the USER and PASSWORD are corrects, I use them when I run odoo instance in my local. ps:USER和PASSWORD是正确的,我在本地运行odoo实例时使用它们。
you might need to add the host network with a flag --network=host
您可能需要使用标志
--network=host
添加主机网络
WARNING: Published ports are discarded when using host network mode
that just means you cannot change the port bindings. WARNING: Published ports are discarded when using host network mode
,已WARNING: Published ports are discarded when using host network mode
,这意味着您无法更改端口绑定。 thats as secure as your machine is.这和你的机器一样安全。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.