我試圖在Ubuntu服務器上設置PostgreSQL遠程連接。Amazon EC2:PostgreSQL遠程連接掛起
我/etc/postgresql/9.3/main/postgresql.conf
改變listen_addresses = 'localhost'
到listen_addresses = '*'
然後我加入到postgre配置文件/etc/postgresql/9.3/main/pg_hba.conf
線
host all all 0.0.0.0/0 md5 host all all ::0/0 md5 host all all all md5
但是,當我試圖通過psql -U db_user -h host -d db_name
來連接遠程數據庫它掛起,並顯示消息
psql: could not connect to server: Connection timed out Is the server running on host "host_address" and accepting TCP/IP connections on port 5432?
pgAdmin的連接掛起以及
您必須在數據庫服務器上運行'pg_ctl reload'才能重新加載新配置。使用數據庫服務器上的'netstat -a'來檢查它是否正在偵聽您期望的端口。嘗試使用telnet在端口5432上打開從客戶端到服務器的TCP連接(或任何您配置的),以查看它是否是網絡問題。 –