密码验证失败,用户身份不匹配

huangapple go评论54阅读模式
英文:

Password authentication failed for user

问题

我在尝试在我的MacOs上运行psql时遇到了问题。psql命令返回以下错误:

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  password authentication failed for user "luicruz"

我该如何解决这个问题?

当终端要求我输入密码时,我尝试输入我的sudo密码,但没有成功。唯一有效的密码是我在安装应用程序时为默认用户"postgres"设置的密码。

我不知道为什么用户'luicruz'会自动创建,我没有创建这个用户或为该用户设置密码。

现在我无法使用psql命令。

以下是显示Pg Admin 4的登录/组规则以及终端命令的返回的图像:

密码验证失败,用户身份不匹配

英文:

I am having a problem trying to run psql on my MacOs. The psql command returns the following error:

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  password authentication failed for user "luicruz" 

How could I fix this?

I try to put my sudo password when the terminal request me the password, but it didn't work. The only password that works is for the default user "postgres" that I set the password when I install the app on my system.

I don't know why the user 'luicruz' was automatically created, I didn't create this user or set a password for this user.

And now I can't use the psql command.

Below is an image showing the login/Group roules of the Pg Admin 4 and also the return of the commands in the terminal

密码验证失败,用户身份不匹配

答案1

得分: 0

问题在于需要在数据库名称之外使用 psql 命令,而我之前不知道这一点。在创建数据库后,我能够在 psql 命令之外使用该命令。

英文:

The problem is that the psql command needs to be used in addition to the database name, and I didn't know that. After creating the database, I was able to use the command apart from the psql command.

huangapple
  • 本文由 发表于 2023年2月19日 02:13:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75495394.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定