首页 > 解决方案 > 升级到 scram-sha-256 密码验证后从 pgadmin 连接

问题描述

我正在尝试为密码身份验证配置 scram-sha-256。我将 postgresql.conf 更改为:

password_encryption = scram-sha-256 

我升级了密码,\password 然后将 pg_hba.conf 更改为:

local all all scram-sha-256

尽我所能启动 postgres 并使用升级后的密码从 psql 连接。

但是,我无法从 PGadmin 登录,即使在我的 postgresql.conf 中它配置为:

listen_addresses = '*'

我收到此错误:

致命:用户“postgres”的密码验证失败

如果我尝试在 pg_hba.conf 中更改为:

host all all all scram-sha-256

然后 postgres start 失败:

2020-01-02 11:54:17.046 IST [1] CONTEXT:  line 85 of configuration file "/var/lib/postgresql/data/pg_hba.conf"
2020-01-02 11:54:17.046 IST [1] FATAL:  could not load pg_hba.conf

那么从 pgadmin 启用 scram-sha-256 和连接的正确方法是什么?

标签: postgresqlpgadmin

解决方案


推荐阅读