繁体   English   中英

postgresql / pgAdmin - 服务器不听问题

[英]postgresql / pgAdmin - server doesn't listen issue

我正在我的新 macbook pro 上设置 postgresql/pgadmin。 但是,当我注册新服务器时,出现错误:

Server doesn't listen
The server doesn't accept connections: the connection library reports 
could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? 

我浏览了这个问题,显然答案是编辑pg_hba.conf文件。 但是,我需要以下方面的帮助:

1) 如何找到并打开该文件?

2) 一旦我打开它,我需要添加哪些语句来解决问题?

有人可以帮忙吗?

提前致谢!

它位于data文件夹内。

例如:PostgreSQL\\9.4\\data\\pg_hba.conf

在那里您会找到以下位置。

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5

如果要从不同的 IP 访问,请添加更改 IP 的同一行的副本。 它很好地解释了here

而且我建议您检查放置在同一目录下的postgresql.conf是否有注释。

#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'      # what IP address(es) to listen on;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM