我试图在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连接(或任何您配置的),以查看它是否是网络问题。 –