一、下载h2到本地:(默认安装到C:Program Files (x86)H2)
下载地址:http://www.h2database.com/html/main.html
下载完成后,一路next安装。然后打开bin目录下h2.bat
点击h2.bat后会自动跳转到网页版数据库
二、导入h2依赖:
com.h2database h2 runtime
三、yml 配置文件:
server:
port: 8081
spring:
datasource:
driver-class-name: org.h2.Driver
password: 123456
url: jdbc:h2:file:~/test;DB_CLOSE_ON_EXIT=FALSE
username: sa
h2:
console:
enabled: true
path: /h2-console
settings:
trace: false
web-allow-others: false
jpa:
database-platform: org.hibernate.dialect.H2Dialect
show-sql: true
hibernate:
ddl-auto: update



