【发布时间】:2017-03-24 11:22:21
【问题描述】:
我正在开发一个 Spring Boot 应用程序:
使用依赖:
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:1.4.1.RELEASE")
compile('org.springframework.boot:spring-boot-starter-data-jpa:1.4.1.RELEASE')
compile('mysql:mysql-connector-java:5.1.39')
}
我想在 init 上运行 sql:
SET NAMES 'utf8mb4'
支持表情符号读/写
我在 application.properties 上进行这些配置
spring.datasource.tomcat.init-sql=SET NAMES 'utf8mb4'
spring.datasource.init-sql=SET NAMES 'utf8mb4'
spring.datasource.connection-init-sql=SET NAMES 'utf8mb4'
但我无法让它工作,并且在应用程序启动时没有日志。
【问题讨论】:
-
您从哪里获得这些 init-sql 属性?我找不到任何关于它们的文档。
-
列在已删除的键下。
标签: spring-boot spring-data spring-data-jpa