How can I solve Postgresql SCRAM authentifcation problem?

I am getting an error after moving the project to production. The error is as follows while running with production server pg_connect(): Unable to connect to PostgreSQL server: SCRAM authentication requires libpq version 10 or above.

Tagged:

Answers

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

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

    Method 1: Upgrade libpq on the application end and try again.

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

    For your OS flavour and required virsion follow the link https://www.postgresql.org/download/linux/redhat/

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

    • set password_encryption = md5 in postgresql.conf
    • change the authentication method to md5 in pg_hba_conf
    • reload PostgreSQL
    • change the password of the user to get an MD5 encrypted password


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!