【问题标题】:hibernate hbm2ddl.auto creates strange SQL query [duplicate]hibernate hbm2ddl.auto 创建奇怪的 SQL 查询 [重复]
【发布时间】:2021-03-10 07:26:26
【问题描述】:

我正在使用 Hibernate(版本“5.4.24.Final”),当应用它的属性“hibernate.hbm2ddl.auto”时,执行了一个奇怪的 SQL 查询:

drop table if exists Student;
create table Student (id integer not null, colour varchar(255), name varchar(255), primary key (id)) type=MyISAM

并且显示此错误的 SQL 服务器无法识别 type=MyISAM

您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的“type=MyISAM”附近使用正确的语法。

谁能帮帮我?

【问题讨论】:

  • 请只标记您实际使用的RDBMS。该错误清楚地表明您正在使用 MySQL,因此我删除了sql-server

标签: mysql hibernate


【解决方案1】:

在 MySQL 中是 ENGINE 不是类型

drop table if exists Student;
 create table Student (id integer not null, colour varchar(255), name varchar(255), primary key (id)) ENGINE =MyISAM

你使用了错误的方言here

【讨论】:

猜你喜欢
  • 2020-03-25
  • 2022-07-14
  • 2012-05-17
  • 2021-09-17
  • 2021-12-20
  • 1970-01-01
  • 2016-02-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多