設置 | 登錄 | 註冊

目前共有3篇帖子。

org.postgresql.util.PSQLException: SCRAM authentication is not supported

1樓 巨大八爪鱼 2024-10-30 23:08

javax.servlet.ServletException: org.postgresql.util.PSQLException: SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" versions)


解决方案,将/var/lib/pgsql/data/postgresql.conf里面的password_encryption = scram-sha-256改为password_encryption = md5,然后在psql命令行里面用ALTER USER postgres PASSWORD语句再设一次postgres用户的密码。

2樓 巨大八爪鱼 2024-10-30 23:10

在psql命令行中,可用show password_encryption命令查看当前password_encryption配置。

$ psql -U postgres -W
Password:
psql (15.6)
Type "help" for help.

postgres=# show password_encryption;
 password_encryption
---------------------
 scram-sha-256
(1 row)

postgres=# \q


默认是postgresql jdbc驱动不支持的scram-sha-256方式。

3樓 巨大八爪鱼 2024-10-30 23:12

将/var/lib/pgsql/data/postgresql.conf里面的password_encryption由scram-sha-256改为md5,重启postgresql服务器后在psql命令行中查看是否生效,然后再设置一遍postgres用户(jdbc连接数据库时使用的用户)的密码即可。

$ psql -U postgres -W

Password:
psql (15.6)
Type "help" for help.

postgres=# show password_encryption;
 password_encryption
---------------------
 md5
(1 row)

postgres=# ALTER USER postgres PASSWORD '密码';
ALTER ROLE
postgres=# \q

內容轉換:

回覆帖子
內容:
用戶名: 您目前是匿名發表。
驗證碼:
看不清?換一張
©2010-2025 Purasbar Ver3.0 [手機版] [桌面版]
除非另有聲明,本站採用知識共享署名-相同方式共享 3.0 Unported許可協議進行許可。