我正在研究Django.我使用PostgreSQL数据库.
完整错误说:
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
你有什么主意吗?
Cra*_*ger 15
野生刺在黑暗中:你的机器上,其中一个IPv6解析器localhost默认使用IPv6地址::1,但是listen_addresses在postgresql.conf设为127.0.0.1或0.0.0.0没有*,或者你使用的是与不具有透明IPv6的C库构建一个旧的PostgreSQL支持.
更改listen_addresses到localhost并确保localhost解析为IPv4和IPv6地址,或将其设置为::1, 127.0.0.1显式指定IPv4和IPv6.或者只是将其设置*为侦听所有接口.或者,如果您不关心IPv6,请连接到127.0.0.1而不是localhost.
有关详细信息,请参阅此Google搜索或此Stack Overflow搜索.
(尽管我的投票结果很紧,因为我投票支持移民问题).