Mysql
 sql >> Datenbank >  >> RDS >> Mysql

Spring Boot - MySQL-Einstellungen funktionieren nicht

Als Spring Boot Dokumentation erwähnt, was mein Problem behoben hat, war das Hinzufügen von spring.datasource.platform zu application.properties . Das hat mir gefehlt, um das Schema mit schema-{platform}.sql zu initialisieren und data-{platform}.sql .

Meine letzte Datei application.properties ist also,

spring.datasource.url = jdbc:mysql://localhost:3306/testdb?useSSL=false
spring.datasource.username = root
spring.datasource.password = password

spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1

spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto = validate
spring.jpa.show-sql = true
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

spring.datasource.platform=mysql
spring.datasource.schema=schema-mysql.sql
spring.datasource.data=data-mysql.sql
spring.datasource.initialize=true
spring.datasource.continue-on-error=true