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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM