我正在尝试启动 PostgreSQL 数据库,但总是失败。
我正在尝试的命令:
psql -h localhost -U postgres
导致错误:
psql: FATAL: Ident authentication failed for user "postgres"
。
内容/var/lib/pgsql/9.5/data/pg_hba.conf
如下:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
我最近对文件进行了更改pg_hba.conf
,我假设我不必重新启动 postgres。我遵循了这一点解决方案但没有帮助。有什么建议可以解决这个问题吗?