我遇到了與外部服務器連接數據庫的問題。我讀了很多關於這個主題的話題。並沒有什麼...設置Postgres:無法遠程連接到Postgres服務器(debian)
PostgreSQL的8.4/Debian的
我/etc/postgresql/8.4/main/ 的postgresql.conf:
listen_addresses = '*'
port = 5432
max_connections = 100
我/etc/postgresql/8.4/main/ 的pg_hba.conf:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 trust
netstat的-nlp | grep的5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 6520/postgres
tcp6 0 0 :::5432 :::* LISTEN 6520/postgres
unix 2 [ ACC ] STREAM LISTENING 15338180 6520/postgres /var/run/postgresql/.s.PGSQL.5432
遠程登錄本地主機5432
Trying 127.0.0.1...
Connected to localhost.localdomain.
但是當我嘗試從我的電腦連接,我總是得到 「無法建立連接」。
任何想法我做錯了什麼? :/感謝您的幫助:)
也許這是一個與IPv6有關的問題,嘗試通過使用'-h'明確添加服務器的ipv4 addrese來遠程連接 – Houari 2013-03-14 19:15:49