Я попытался подключиться к базе данных из кода и получил ошибку: < /p>
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection] with root cause
org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
< /code>
application.properties:
spring.application.name=wow
spring.main.banner-mode=off
logging.level.org.springframework=DEBUG
spring.jpa.hibernate.ddl-auto=none
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/wow
spring.datasource.username=postgres
spring.datasource.password={password}
spring.jpa.show-sql=true
server.port = 8081
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.generate-ddl=false
spring.jpa.properties.hibernate.default_schema=rolls
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
< /code>
compant.yaml:
services:
postgres:
image: 'postgres:latest'
environment:
- 'POSTGRES_DB=wow'
- 'POSTGRES_ROOT_PASSWORD={password}'
- 'POSTGRES_PASSWORD={password}'
- 'POSTGRES_USER=postgres'
ports:
- '5432'
< /code>
Пароль точно верен. Что я должен добавить в код для успешного соединения?
Подробнее здесь: https://stackoverflow.com/questions/793 ... pring-boot
Получение фатальной: аутентификация пароля не удалась для пользователя «Postgres» в проекте Spring-Boot ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Аврора — аутентификация пароля для пользователя «postgres» не удалась — после смены пароля
Anonymous » » в форуме Python - 0 Ответы
- 24 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Аврора — аутентификация пароля для пользователя «postgres» не удалась — после смены пароля
Anonymous » » в форуме Python - 0 Ответы
- 27 Просмотры
-
Последнее сообщение Anonymous
-