1、不支援 10 验证类型。请核对您已经组态 pg_hba.conf 文件包含客户端的IP位址或网路区段,以及驱动程序所支援的验证架构模式已被支援。
解决方法:
- 找到C:\Program Files\PostgreSQL\13\data目录下的pg_hba.conf
- 将下列注释掉
# TYPE DATABASE USER ADDRESS METHOD
## "local" is for Unix domain socket connections only
#local all all scram-sha-256
## IPv4 local connections:
#host all all 127.0.0.1/32 scram-sha-256
## IPv6 local connections:
#host all all ::1/128 scram-sha-256
## Allow replication connections from localhost, by a user with the
## replication privilege.
#local replication all scram-sha-256
#host replication all 127.0.0.1/32 scram-sha-256
#host replication all ::1/128 scram-sha-256
- 添加下列语句
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
2、用postgresql报错:org.postgresql.util.PSQLException: 这个 ResultSet 已经被关闭。
原因:
是因为我用的是10 版本,之前的 postgresql 是9版本,mavenjar 也随之升级
解决方法:
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.22</version>
</dependency>