Как подключиться к консоли H2 из Spring boot? - PullRequest
0 голосов
/ 04 ноября 2019
driverClassName=org.h2.Driver
url=jdbc:h2:mem:myDb;DB_CLOSE_DELAY=-1
username=sa
password=sa

hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create-drop
spring.h2.console.enabled=true

Неверное имя пользователя или пароль, почему?

enter image description here

1 Ответ

0 голосов
/ 04 ноября 2019

В вашем application.properties

spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect

см. учебник

...