Datasource.url, похоже, недоступен

Мне нужно подключить внутреннюю базу данных, и мне посоветовали добавить в нее следующие данные:

Похоже, это не работает, учитывая возврат в консоли:

Я немного запутался...

Я ожидаю увидеть логи, указывающие на то, что база данных работает

server.port=8090
spring.datasource.url=jdbc:mysql://localhost:3306/pmt
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
15:16:32.620 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.codesolutions.pmt_backend.PmtBackendApplicationTests]: PmtBackendApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
15:16:32.713 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.codesolutions.pmt_backend.PmtBackendApplication for test class com.codesolutions.pmt_backend.PmtBackendApplicationTests
15:16:32.858 [main] INFO org.springframework.boot.devtools.restart.RestartApplicationListener -- Restart disabled due to context in which it is running

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.3.2)

2024-08-20T15:16:33.274+02:00  INFO 29248 --- [           main] c.c.p.PmtBackendApplicationTests         : Starting PmtBackendApplicationTests using Java 22.0.2 with PID 29248 (started by etien in C:\Users\etien\pmt-backend\pmt-backend)
2024-08-20T15:16:33.275+02:00  INFO 29248 --- [           main] c.c.p.PmtBackendApplicationTests         : No active profile set, falling back to 1 default profile: "default"
2024-08-20T15:16:34.165+02:00  INFO 29248 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2024-08-20T15:16:34.201+02:00  INFO 29248 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 15 ms. Found 0 JPA repository interfaces.
2024-08-20T15:16:34.777+02:00  INFO 29248 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2024-08-20T15:16:34.831+02:00  INFO 29248 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.5.2.Final
2024-08-20T15:16:34.862+02:00  INFO 29248 --- [           main] o.h.c.internal.RegionFactoryInitiator    : HHH000026: Second-level cache disabled
2024-08-20T15:16:35.151+02:00  INFO 29248 --- [           main] o.s.o.j.p.SpringPersistenceUnitInfo      : No LoadTimeWeaver setup: ignoring JPA class transformer
2024-08-20T15:16:35.185+02:00  INFO 29248 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2024-08-20T15:16:35.520+02:00  INFO 29248 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@62faf77
2024-08-20T15:16:35.522+02:00  INFO 29248 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2024-08-20T15:16:35.571+02:00  WARN 29248 --- [           main] org.hibernate.orm.deprecation            : HHH90000025: MySQL8Dialect does not need to be specified explicitly using 'hibernate.dialect' (remove the property setting and it will be selected by default)
2024-08-20T15:16:35.572+02:00  WARN 29248 --- [           main] org.hibernate.orm.deprecation            : HHH90000026: MySQL8Dialect has been deprecated; use org.hibernate.dialect.MySQLDialect instead
2024-08-20T15:16:35.985+02:00  INFO 29248 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2024-08-20T15:16:35.991+02:00  INFO 29248 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2024-08-20T15:16:36.249+02:00  WARN 29248 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2024-08-20T15:16:37.094+02:00  INFO 29248 --- [           main] c.c.p.PmtBackendApplicationTests         : Started PmtBackendApplicationTests in 4.229 seconds (process running for 5.137)
WARNING: A Java agent has been loaded dynamically (C:\Users\etien\.m2\repository\net\bytebuddy\byte-buddy-agent\1.14.18\byte-buddy-agent-1.14.18.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2024-08-20T15:16:37.657+02:00  INFO 29248 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2024-08-20T15:16:37.660+02:00  INFO 29248 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2024-08-20T15:16:37.670+02:00  INFO 29248 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
Лазарь
Вопрос задан24 февраля 2024 г.

1 Ответ

Ваш ответ

Загрузить файл.