Unable to connect to Postgress DB due to the authentication type 10 is not supported

前端 未结 4 1008
失恋的感觉
失恋的感觉 2020-12-19 21:42

I have recently tried my hands on Postgres. Installed it on local(PostgreSQL 13.0). Created a maven project and used Spring Data JPA, works just fine. Whereas when I tried u

相关标签:
4条回答
  • 2020-12-19 22:23

    I guess the solution to this problem is using version 9.6. It works just fine after changing the version.

    0 讨论(0)
  • 2020-12-19 22:24

    I solved similar issue by applying below steps in PostgreSQL Version 13 :

    1. Change password_encryption to md5.

      File: C:\Program Files\PostgreSQL\13\data\postgresql.conf

    2. Change scram-sha-256 to md5 in host settings.

      File: C:\Program Files\PostgreSQL\13\data\pg_hba.conf.

      host all all 0.0.0.0/0 md5

    3. Change Password ( this restore password in md5 format).

      Example: ALTER ROLE postgres WITH PASSWORD 'root';

    4. Make sure you set listen_addresses = '*' if you are working non production environment.

      File : C:\Program Files\PostgreSQL\13\data\postgresql.conf

    0 讨论(0)
  • 2020-12-19 22:28

    Use latest maven dependency for Postgres in pom.xml

    0 讨论(0)
  • 2020-12-19 22:36

    By setting password_encryption to scram-sha-256 (which is the default value in v13) you also get scram-sha-256 authentication, even if you have md5 in pg_hba.conf.

    Now you are using an old JDBC driver version on the client side that does not support that authentication method, even though PostgreSQL introduced it in v10, three years ago.

    You should upgrade your JDBC driver. An alternative would be to set password_encryption back to md5, but then you'll have to reset all passwords and live with lower security.

    0 讨论(0)
提交回复
热议问题