我已经在我的 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.