重点 两个配置:
AUTO_SERVER=TRUE;
web-allow-others: true
完整配置如下:
spring:
datasource:
url: jdbc:h2:file:~/test/test_data;DB_CLOSE_ON_EXIT=FALSE;mode=mysql;AUTO_SERVER=TRUE;
driver-class-name: org.h2.Driver
username: sa
password:
schema: classpath:/db/schema.sql
h2:
console:
enabled: true
settings:
web-allow-others: true