【发布时间】:2018-10-20 11:10:05
【问题描述】:
我无法从 datagrip(jetbrains 应用程序)连接到 postgres。我正在尝试连接,但收到此消息
Connection to postgres@172.18.0.3 failed.
[08001] Connection to 172.18.0.3:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
昨天一切都很好。我的数据库在 docker 容器中,有 yml 文件:
postgres_host:
image: postgres:10-alpine
restart: always
ports: ["5433:5432"]
volumes:
- /tmp/lib:/var/lib/postgresql/data/pg_data
environment:
- PGDATA=/tmp/lib
我可以从终端连接到数据库,我使用了 select inet_server_addr( ), inet_server_port( );并且知道我知道主机和端口
inet_server_addr | inet_server_port
------------------+------------------
172.18.0.3 | 5432
但是这些信息对我没有帮助,我有同样的结果 enter image description here
【问题讨论】:
标签: database postgresql docker datagrip