刚开始学docker,还不太熟,花了好几天功夫学习,可是odoo的docker image,就是连不到外部的数据库,后经搜索发现问题所在。
Open /usr/local/var/postgres/pg_hba.conf and add this line:
host all all 172.17.0.0/16 md5
Open /usr/local/var/postgres/postgresql.conf and
edit change listen_addresses:
listen_addresses = '*'
Reload service and launch your container:
在postgresql里,这样设置,在odoo.conf 中 host=外部主机的内网IP,就能访问宿主机的postgresql了
本文介绍了解决Odoo Docker镜像无法连接到外部数据库的问题。通过修改postgresql配置文件pg_hba.conf和postgresql.conf,设置监听地址并重启服务,使Odoo能够成功连接到宿主机的PostgreSQL。
1964

被折叠的 条评论
为什么被折叠?



