加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 服务器是否在主机“localhost”(:: 1)上运行,并且

发布时间:2020-12-13 16:46:40 所属栏目:百科 来源:网络整理
导读:我正在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? 你有什么主意吗? 在黑暗中
我正在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?

你有什么主意吗?

在黑暗中野生刺:你在一台带有IPv6解析器的机器上,其中localhost默认为IPv6地址:: 1,但postgresql.conf中的listen_addresses设置为127.0.0.1或0.0.0.0 not *或者你正在使用一个用不具有透明IPv6支持的C库构建的旧的PostgreSQL。

将listen_addresses更改为localhost,并确保localhost解析为IPv4和IPv6地址,或将其设置为:: 1,127.0.0.1以明确指定IPv4和IPv6。或者只是设置为*在所有接口监听。或者,如果您不关心IPv6,请连接到127.0.0.1而不是localhost。

有关详细信息,请参阅this Google search或this Stack Overflow search。

(尽管我的投票表决,因为我投票的移民问题)。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读