相关疑难解决方法(0)

从命令行使用postgresql获取身份验证失败错误

当我尝试从这样的命令行登录时

psql -h dbserver -U testuser test
Run Code Online (Sandbox Code Playgroud)

然后我得到这个错误

psql: FATAL:  Ident authentication failed for user "testuser"
Run Code Online (Sandbox Code Playgroud)

这是我的

nano -w /var/lib/pgsql/data/pg_hba.conf

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident
# IPv4 local connections:
host    all         all         127.0.0.1/32          password
# IPv6 local connections:
host    all         all         ::1/128               ident
host    all     all     192.168.0.1/24  password
Run Code Online (Sandbox Code Playgroud)

postgresql centos

4
推荐指数
1
解决办法
9419
查看次数

标签 统计

centos ×1

postgresql ×1