在使用Navicat Premium 12版本连接pg 12数据库时,报错“authentication method 10 not supported”

解决方案一:(配置conf)

pg_hba.conf文件的内容如下:

# "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
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust
host all all all scram-sha-256
#hostssl all all all cert

编辑/var/lib/pgsql/13/data/postgresql.conf

增加

listen_addresses = ‘*’

编辑/var/lib/pgsql/13/data/pg_hba.conf

增加:

host all all 0.0.0.0/0 password

然后重启 systemctl restart postgresql-13

解决方案二:(navicat认证版本低)

在确保参数listen_addresses = ‘*’,并且pg_hba.conf支持远程连接的条件下,执行pg_ctl reload后,还是报错。

这个主要原因是认证方式使用的是scram-sha-256或md5,而客户端的Navicat的libpq.dll并不支持scram-sha-256和md5。

所以,解决方法是将最新的PG版本的libpq.dll文件拷贝到Navicat的安装目录中

在这里插入图片描述
将该文件替换后即可解决问题,记得备份该文件哦!

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐