Caused by: java.sql.SQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes

设置默认使用Innodb引擎

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/lance?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.validation-query=SELECT 1;
spring.datasource.initial-size=2
spring.datasource.sql-script-encoding=UTF-8

# spring.jpa.database=h2
spring.jpa.database=mysql
spring.jpa.show-sql=true

# spring boot2.+后默认使用的是MyISAM引擎
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect # 设置默认使用Innodb引擎

spring.jpa.hibernate.ddl-auto=update
posted @ 2020-06-16 18:52  LanceLi  阅读(1244)  评论(0编辑  收藏  举报