服务器意外关闭了连接python

时间:2020-04-04 20:16:14

标签: python-3.x postgresql ubuntu docker-compose

server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

以及当我与docker exec一起运行时...

psql: error: could not connect to server: could not translate
 host name "potgres" to address: No address associated with hostname

我的港口似乎是这样的:

0.0.0.0:5431->5431/tcp, 5432/tcp

即使我更改了file.yml中的端口号,也没有任何反应!

1 个答案:

答案 0 :(得分:2)

您确定自己的主机名拼写正确吗?

psql:错误:无法连接到服务器:无法翻译 主机名“ potgres”到地址:没有与主机名关联的地址

您似乎将postgres拼写为potgres。