我只是最近通過SSH在我們的服務器上安裝PostgreSQL。軟件的安裝很順利,直到我試圖時間來連接它使用pgAdmin的在我的Windows machine.I收到這樣那樣的錯誤:postgresql服務器不聽
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "xxx.xxx.xxx.xxx" and accepting TCP/IP connections on port 5432?
xxx.xxx.xxx.xxx =我的服務器的公網IP。
該文檔建議這可以通過在/etc/postgresql/9.1/main/postgresql.conf設定listen_addresses = '*'
值是固定的。我做到了,但仍然不讓我。
其他錯誤想出了
FATAL: no pg_hba.conf entry for host "xxx.xx.xxx.xxx", user "postgres", database "postgres", SSL on FATAL: no pg_hba.conf entry for host "xxx.xx.xxx.xxx", user "postgres", database "postgres", SSL off
xxx.xx.xxx.xxx =我的IP地址。
什麼似乎是我失蹤?
PSQL通過SSH遠程定接入
我現在可以通過pgAdmin連接到postgres,但是我硬編碼了我的IP地址'host all all 122.55.37.1XX/32 md5'.How can I make it like like a wildcard that fit that IP address category? –
@LeandroGarcia:使用IP地址,您需要考慮「位掩碼」,而不是「通配符」。這取決於您想要接受連接的IP地址數量以及最後兩位數字是什麼。例如,122.55.37.100/29將覆蓋122.55.37.97至122.55.37.102的範圍; 122.55.37.130/29將覆蓋122.55.37.129至122.55.37.134; 122.55.37.166/27將覆蓋122.55.37.161至122.55.37.190。 (我認爲,谷歌的「在線子網計算器」,或者沿着這些線尋求幫助的位掩碼。) –