如何解决Postgresql SCRAM身份验证问题? [英] How can I solve Postgresql SCRAM authentifcation problem?

查看:1088
本文介绍了如何解决Postgresql SCRAM身份验证问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将项目移至生产环境后出现错误.在生产服务器上运行时,错误如下:

I am getting an error after moving the project to production. The error is as follows while running with production server

pg_connect():无法连接到PostgreSQL服务器:SCRAM身份验证需要libpq版本10或更高版本.

这是我的postgreSQL版本:

Here is my postgreSQL version:

开发版本:

x86_64-pc-linux-gnu上的PostgreSQL 11.5,由gcc(GCC)编译4.8.5 20150623(Red Hat 4.8.5-36),64位

PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit

生产版本:

x86_64-pc-linux-gnu上的PostgreSQL 11.5(EnterpriseDB Advanced Server 11.5.12),由gcc(GCC)4.8.5 20150623(Red Hat 4.8.5-36)编译,64位

PostgreSQL 11.5 (EnterpriseDB Advanced Server 11.5.12) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit

推荐答案

您的应用程序使用与PostgreSQL客户端C库 libpq 链接的API.

Your application uses an API that is linked with the PostgreSQL client C library libpq.

该库的版本必须为9.6或更早,并且v10中引入了SCRAM身份验证.

The version of that library must be 9.6 or older, and SCRAM authentication was introduced in v10.

在应用程序端升级 libpq ,然后重试.

Upgrade libpq on the application end and try again.

如果不需要 scram-sha-256 身份验证,则可以还原为 md5 :

If you don't need scram-sha-256 authentication, you can revert to md5:

    postgresql.conf
  • 设置 password_encryption = md5
  • pg_hba_conf
  • 中将身份验证方法更改为 md5
  • 重新加载PostgreSQL
  • 更改用户密码以获取MD5加密密码

这篇关于如何解决Postgresql SCRAM身份验证问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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