postgresql psql:error:connection to server at“localhost”(::1),port 5432 failed:FATAL:password authentication failed for user“postgres”如何修复?

ne5o7dgx  于 5个月前  发布在  PostgreSQL
关注(0)|答案(1)|浏览(159)

所以我最近通过enterpriseDB下载了postgres,并一直试图通过我的终端访问超级用户postgres。我输入psql -U postgres,在输入密码后,我得到了以下消息:
“用户postgres的密码:psql:错误类型:连接到服务器“localhost”(::1),端口5432失败:FATAL:用户“postgres”的密码身份验证失败
我进入我的pg_hba.config文件,并改变了方法,以md5像别人说,我没有得到任何地方。我仍然停留在同一个地方。请任何帮助将不胜感激。
我试着改变配置文件中的方法,但是没有任何进展。我也试着查找它,但是对于我的特定问题没有任何收获。

mhd8tkvw

mhd8tkvw1#

在您强化之前默认安装postgres,它对所有本地连接使用信任#pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# 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     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

字符串
所以从localhost你应该能够做psql postgres postgres,它不会提示你输入密码
你想共享操作系统/主机,pg_hba.conf和listen_address行在你的postgresql.conf中的样子吗

相关问题