psql 身份验证失败, --host=localhost [英] psql authentication fails with --host=localhost

查看:85
本文介绍了psql 身份验证失败, --host=localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用命令:

psql --dbname=mattermost --username=mmuser --password

然后如果我输入密码它会成功,但是如果我写:

then if I place the password it succeeds, but if I write:

psql --host=localhost --dbname=mattermost --username=mmuser --password

然后相同的密码导致身份验证失败

then the same password gives authentication fails

我该如何解决这个问题?

How can I resolve this?

推荐答案

所以在这个尝试使用

 psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

检查 pg_hba.conf 进一步了解信息.所以如果在你的 pg_hba.conf 文件中的下面一行

check the pg_hba.conf for further info. So if below line in your pg_hba.conf file

 host    all         all        localhost             trust

然后它也将开始使用本地主机

then it will start working with localhost also

这篇关于psql 身份验证失败, --host=localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆