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;'。有一個可以過濾連接的軟件防火牆嗎? –