【发布时间】:2019-10-06 03:50:06
【问题描述】:
刚刚从 spring 初始化程序创建了一个简单的 spring-boot 项目。我去添加一个本地 h2 db 进行测试,但无法登录。似乎它在启动时无法创建测试数据库,但无法弄清楚为什么会出现这种情况。
spring:
h2:
console:
enabled: true
path: /h2
datasource:
url: jdbc:h2:mem:testdb;
username: sa
password:
driver-class-name: org.h2.Driver
platform: h2
jpa:
show-sql: true
hibernate:
ddl-auto: create
properties:
hibernate:
dialect=org:
hibernate:
dialect:
H2Dialect: org.hibernate.dialect.H2Dialect
Database "mem:testdb" not found, and IFEXISTS=true, so we cant auto-create it [90146-199] 90146/90146
【问题讨论】:
-
不确定是否重要,但您在数据源 url 中有一个分号
标签: spring-boot h2