Spring无法在树莓派上连接到PostgreSQL:连接尝试失败

时间:2019-05-17 15:12:47

标签: java spring postgresql spring-boot jdbc

我已经在Raspberry上安装并配置了PostgreSQL数据库。使用pgAdmin4客户端,我可以轻松地连接到数据库,但是在将SpringBoot连接到数据库时遇到了问题。

树莓:pg_hba.conf

host    all             all             0.0.0.0/0            trust
host    all             all             ::/0                 trust

树莓:postgresql.conf

listen_addresses = '*' 
port = 5432 

春季:application.properties

server.port = 8080
spring.application.name = kickr

spring.h2.console.enabled = true
spring.h2.console.path = /console
spring.h2.console.settings.trace = false
spring.h2.console.settings.web-allow-others = false

spring.datasource.url = jdbc:postgresql://192.169.2.101:5432/testdb
spring.datasource.username = ...
spring.datasource.password = ...

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto = create      

启动后错误

2019-05-17 16:48:02.901 ERROR 16952 --- [main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.

org.postgresql.util.PSQLException: The connection attempt failed.

0 个答案:

没有答案