因此,在尝试连接到 OSX 上的 Postgres 实例时出现错误。
我收到此错误:
Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
我运行这个:
ps -ax | grep postgres
得到这个:
7782 ?? 0:00.06 /usr/local/opt/postgresql@9.6/bin/postgres -D /usr/local/var/postgresql@9.6
7786 ?? 0:00.00 postgres: checkpointer process
7787 ?? 0:00.01 postgres: writer process
7788 ?? 0:00.00 postgres: wal writer process
7789 ?? 0:00.00 postgres: autovacuum launcher process
7790 ?? 0:00.00 postgres: stats collector process
7794 ttys000 0:00.00 grep postgres
/tmp/.s.PGSQL.5432 存在,尽管它具有“守护进程”组,而不是具有“轮子”的其他所有内容。
我通过 brew 设置 Postgres 9.6。
这可能是什么原因造成的?
我的 pg_hba.conf 看起来像这样:
host all all 0.0.0.0/0 trust
hostnossl all all 0.0.0.0/0 trust
这可能是什么原因造成的?
这是 postgres 日志所说的:
2017-12-15 19:40:37 UTC LOG: database system was shut down at 2017-12-15 19:40:32 UTC
2017-12-15 19:40:37 UTC LOG: MultiXact member wraparound protections are now enabled
2017-12-15 19:40:37 UTC LOG: database system is ready to accept connections
2017-12-15 19:40:37 UTC LOG: autovacuum launcher started
我只是没有看到任何可能导致这种情况的东西。
完整的 pg_hba.conf:
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
#
# TYPE DATABASE USER ADDRESS METHOD
# Default:
# Added by ansible
# Added by ansible
host all all 0.0.0.0/0 trust
hostnossl all all 0.0.0.0/0 trust
local all all trust
# Password hosts
# Trusted hosts
# User custom