1

I'm using Hibernate ( version "5.4.24.Final" ) and when applying its property "hibernate.hbm2ddl.auto" there is a strange SQL query executed:

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

and the type=MyISAM is not recognised by SQL server which shows this error

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.

Could anyone give me an help?

Thom A
  • 88,727
  • 11
  • 45
  • 75
stykky
  • 33
  • 3
  • Please only tag the RDBMS you are *actually* using. The error clearly states you are using MySQL, so I have removed [tag:sql-server]. – Thom A Nov 27 '20 at 14:00

1 Answers1

1

In MySQL it is ENGINE not type

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

You are using the wrong dialect as explained here

nbk
  • 45,398
  • 8
  • 30
  • 47
  • I have no control to the query, it's automatically generated by hibernate framework. Thank you for advice anyways – stykky Nov 27 '20 at 14:06
  • Soory i forgot to mention https://stackoverflow.com/questions/43716068/invalid-syntax-error-type-myisam-in-ddl-generated-by-hibernate – nbk Nov 27 '20 at 14:10