当前位置:首页 > python SCRAM authentication requires libpq version 10 or above

python SCRAM authentication requires libpq version 10 or above

点击次数:4264  更新日期:2021-11-06

python在centos7下连接postgresql数据库报错:

python SCRAM authentication requires libpq version 10 or above

大概意思是libpg的版本低了,但使用 yum install postgresql-devel 只能更新到 9.2.24版本


[参考网址](https://pkgs.org/download/postgresql-devel)

安装postgresql10-devel:

https://centos.pkgs.org/7/postgresql-10-x86_64/postgresql10-devel-10.18-1PGDG.rhel7.x86_64.rpm.html

到这个页面找到安装方法:

“Add PostgreSQL 10 repository as described on its homepage:

https://yum.postgresql.org/repopackages.php

Install postgresql10-devel rpm package:

# yum install postgresql10-devel”


# 查看pg版本

pg_config --version


1. 添加源

rpm -Uvh https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

2. 安装新版本

yum install postgresql10-devel

3. 查找pg_config的位置

find / -type f -name "pg_config"

4. 先删除 /usr/bin 下的 pg_config

5. 建立软连接

 ln -s /usr/pgsql-10/bin/pg_config pg_config

6. 再次查看 pg_confg 版本是不是更新了

#pg_config --version

PostgreSQL 10.18