[英]Connect local postgres database from PGAdmin Container
我正在尝试从容器中的 PGadmin 连接到我的本地 postgres 数据库,但它是通过以下错误:
Unable to connect to Server: connection to server at "localhost" (127.0.0.1), port 5432 failed. connection refused is the server running on that host and accepting TCP/IP connections?
我正在尝试创建服务器的配置如下:
hostname/address = localhost
port = 5432
username = postgres
我的操作系统配置
OS = Linux- Ubuntu
Version = 18.04
PS:在 Stackoverflow 上有一些关于此的现有问题,但没有解决方案对我有帮助。
虽然它在本地运行,但 docker 容器就像一台不同的机器。 你需要把本地主机的IP地址而不是localhost。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.