正如Spring引导文档中提到的那样,解决我的问题的方法是添加
spring.datasource.platform到
application.properties。这就是我缺少使用
schema-{platform}.sql和初始化架构的原因
data-{platform}.sql。
{platform} =的值
spring.datasource.platform
所以我最后的application.properties文件是
spring.datasource.url = jdbc:mysql://localhost:3306/testdb?useSSL=falsespring.datasource.username = rootspring.datasource.password = passwordspring.datasource.testWhileIdle = truespring.datasource.validationQuery = SELECT 1spring.datasource.driverClassName = com.mysql.jdbc.Driverspring.jpa.hibernate.ddl-auto = validatespring.jpa.show-sql = truespring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategyspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialectspring.datasource.platform=mysqlspring.datasource.schema=schema-mysql.sqlspring.datasource.data=data-mysql.sqlspring.datasource.initialize=truespring.datasource.continue-on-error=true
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)