【发布时间】:2022-11-10 22:57:42
【问题描述】:
我尝试使用 localhost 推荐的命令来学习玩 docker。 确切的命令是:
docker run -it --rm postgres psql
我得到的错误信息是:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
实际上文件 .s.PGSQL.5432 在容器中不存在,但它存在 在主机上。 那么,我的推理/命令有什么问题?
【问题讨论】:
-
当您像这样运行 psql 时,它需要一个可以连接到的正在运行的 postgres 实例。你有吗?
标签: postgresql docker psql