简体   繁体   English

psql: 致命: 密码验证失败

[英]psql: FATAL: password authentication failed

When ever I am trying to run psql in the command line, it is asking for a Password: .当我尝试在命令行中运行 psql 时,它要求输入Password:

I'm not too sure what the username and password is.我不太确定用户名和密码是什么。

I installed postgresql by brew install postgres我通过brew install postgres

pg_hba.conf pg_hba.conf

# the database superuser.  If you do not trust all your local users,
# use another authentication method.


# 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     AustinTruong                                trust
#host    replication     AustinTruong        127.0.0.1/32            trust
#host    replication     AustinTruong        ::1/128                 trust

Let me know if there is any confusion in my question.如果我的问题有任何混淆,请告诉我。

Edit编辑

在此处输入图片说明

In other posts, it mentions if I change pg_hba.conf file to local all all trust , I shouldn't require a password.在其他帖子中,它提到如果我将 pg_hba.conf 文件更改为local all all trust ,我不应该需要密码。 But it is still requesting for a password.但它仍然要求输入密码。

When I run brew info postgres当我运行brew info postgres 在此处输入图片说明

I've followed the steps from Postgresql: password authentication failed for user "postgres" , but i'm still having the same issue.我已经按照Postgresql: password authentication failed for user "postgres" 中的步骤操作,但我仍然遇到同样的问题。 I added the line我添加了该行

local all postgres ident

If you want to create a new database account from you own OS account use:如果要从自己的操作系统帐户创建新的数据库帐户,请使用:

/usr/local/bin/createdb someusername

See if this works.看看这是否有效。 Also this other SO Question might help.另外这个其他SO问题可能会有所帮助。

Edit:编辑:

Use brew info postgres for more information about your version.使用brew info postgres获取有关您的版本的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 psql:严重:用户“ postgres”的密码身份验证失败 - psql: FATAL: password authentication failed for user “postgres” psql:严重:用户“ akhil”的密码身份验证失败 - psql: FATAL: password authentication failed for user “akhil” psql:致命:用户 windows 8 的密码验证失败 - psql: FATAL: password authentication failed for user windows 8 psql:致命:用户 {user} 的密码验证失败 - psql: FATAL: password authentication failed for user {user} psql:致命:用户“icinga”的密码验证失败 - psql: FATAL: password authentication failed for user "icinga" 忘记了psql密码:sql:严重:用户“ username”的密码验证失败 - Forgotten psql Password: sql: FATAL: password authentication failed for user “username” psql:错误:无法连接到服务器:致命:用户密码验证失败 - psql: error: could not connect to server: FATAL: password authentication failed for user psql:致命:用户“postgres”postgresql 版本 10 的密码验证失败 - psql: FATAL: password authentication failed for user "postgres" postgresql version 10 Heroku pg:push psql: FATAL: 用户密码验证失败 - Heroku pg:push psql: FATAL: password authentication failed for user psql:严重:用户“ postgres” WINDOWS的密码身份验证失败 - psql: FATAL: Password authentication failed for user “postgres” WINDOWS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM