我有一个运行postgres的数据库服务器(192.168.1.50)。我创建了一个名为“testdb”的数据库和一个名为“testuserpw”的用户“testuser”。
在本地,我可以使用连接到数据库:无法从远程主机连接到postgres
psql -d testdb -U testuser
当我从另一台主机(192.168.1.60)发出命令:
psql -h 192.168.1.50 -d testdb -U testuser
我有错误:
psql: could not connect to server: Connection refused
Is the server running on host "192.168.1.50" and accepting
TCP/IP connections on port 5432?
有什么想法?
需要注意的是,还有一个pg_hba.conf配置文件,您可以在其中为特定机器配置信任属性。 – OleTraveler 2011-05-27 16:06:20
它必须设置为“*”。也许这会在一两分钟内拯救某个人。 – Kolyunya 2014-08-01 10:41:32