休眠添加'type=MyISAM' 使用 JPA 创建的表时



我用JPA启动了我的应用程序,它想为我创建一些表。问题是Hibernate添加了一些额外的SQL代码('type=MyISAM'(。

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table person (id integer not null auto_increment, name varchar(255), uuid binary(255), primary key (id)) type=MyISAM" via JDBC Statement
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=MyISAM' at line 1

我知道hibernate添加到SQL查询中的"type=MyISAM"是什么。。。

这里有人知道这是怎么回事吗?

这是一个DB方言问题。

如果您使用的是mysql数据库,请在application.properties文件中添加以下属性密钥:--

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

。。。和MySQL 8

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect