【发布时间】:2017-08-05 09:43:41
【问题描述】:
我已经安装了 PostgreSQL。但是,每次我尝试通过 PGAdmin 或通过 psql 连接时,都会出现以下错误。
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and
accepting TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and
accepting TCP/IP connections on port 5432?
我检查了postgresql.conf 文件,并且该行:listen_addresses = '*' 没有被注释掉。
这也是我的pg_hba.conf 文件的设置方式:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
谁能告诉我如何解决这个问题?
谢谢!
【问题讨论】:
-
pg_hba.conf,不是pg_hba.conf.txt
标签: postgresql server connection localhost connection-refused