我不是通信网络方面的专家,所以我不知道我的“主机名”应该是什么以及在哪里可以找到它?
我在 ubuntu 14.04 上创建了一个 postgreSQL 服务器,通过将主机名设置为 127.0.0.1(localhost),甚至 192.168.1.42(我的私有 IP),我可以毫无问题地从同一台计算机连接到它。但我无法从任何其他计算机连接到我的服务器,即使它们是否在本地网络上。我总是收到这样的消息:
"Connection to <hostname>:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections."
Run Code Online (Sandbox Code Playgroud)
其中 127.0.1.1、127.0.0.1、192.168.1.42、98.765.432.123(public ip) 或其他任何地址,它都不起作用。正确的主机名是什么?
我已经将listen_addresses设置为'*',已经编辑pg_hba.conf以接受0.0.0.0/0 IP-s,并禁用ubuntu防火墙。