在 Docker 中运行的 PgAdmin 无法连接到 Postgres 服务器

问题描述 投票:0回答:0

我有

pgadmin
Docker 容器中运行(在我的浏览器中可用,网址为 http://localhost:8080) Postgres 安装在我的系统中(不是 Dockerized),我可以使用以下方式连接到它:

import sqlalchemy
engine = sqlalchemy.create_engine('postgresql://bob:[email protected]:5432/postgres')
engine.connect()

问题是,当我在 pgadmin 中创建一个服务器,并尝试连接到主机名/地址 127.0.0.1,端口 5432,维护数据库 postgres,user bob,和password 1234,我得到:

Unable to connect to server: connection to server at "127.0.0.1", port 5432 failed Connection refused. Is the server running on that host and accepting TCP/IP connections?
docker pgadmin
© www.soinside.com 2019 - 2024. All rights reserved.