0
我试图用127.0.0.1
作为IP地址连接到PostgreSQL的本地实例连接到PostgreSQL,但连接始终否认:无法通过127.0.0.1
⟩ psql -h 127.0.0.1 -U postgres -p 5432
psql: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
我pg_hba.conf
看起来是这样的:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all password
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 trust
我postgresql.conf
有如下条目:
listen_addresses = 'localhost, 127.0.0.1'
port=5432
unix_socket_directories = '/private/tmp'
但是我可以通过unix插座进行连接。还有什么可以阻止连接?
x发布为https://dba.stackexchange.com/q/183263/7788 –
在unix套接字连接上运行'SHOW port; SHOW listen_addresses;'。有一个可以过滤连接的软件防火墙吗? –