链接PostgreSQL异常 致命错误: 用户 "postgres" Password 认证失败 (pgjdbc: autodetected server-encoding to be GB2312 解决方案

找到安装目录,然后寻找data文件夹下面的pg_hba.conf
修改文件内容
将最下面的 scram-sha-256 加密方式修改为 trust

 # "local" is for Unix domain socket connections only
local   all             all                                     scram-sha-256
# IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256
# IPv6 local connections:
host    all             all             ::1/128                 scram-sha-256

修改为

# "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

重启数据库服务

posted @ 2022-07-18 14:01  Ideaway  阅读(9052)  评论(3)    收藏  举报