[英]Remotely connect to Database in Container from Host Machine?
我想你所说的“GUI 应用程序”是指像 PgAdmin 或你最喜欢的 IDE 这样的 postgres 客户端?
您只需要配置您的客户端数据源,正如我们在您的日志中看到的那样,我的意思是:
host : localhost
port : 5432 (or the one mapped in your docker-compose.yml file)
database : It's not "monitor" as it doesn't find it !
user and password : in your docker-compose.yml too. Visibly it's not "root" as id doesn't find it.
您的 docker-compose.yml 应该是您项目的根目录。
如果您的 docker-compose 中缺少它,您可以添加它:
version: "3.7"
services:
main:
image: postgres:12.7-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=password
- POSTGRES_DB=monitor
此致。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.