GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement

You should try a different dialects likeorg.hibernate.dialect.MySQL5Dialect OR org.hibernate.dialect.MySQLMyISAMDialect OR org.hibernate.dialect.MySQLInnoDBDialect to see which one works for you.

All in all , your current dialect is generating , type=MyISAM while it should be , ENGINE=MyISAM in create table query.

mysql error 'TYPE=MyISAM'

You should read this too , Why do I need to configure the SQL dialect of a data source?

Your logs say that this query was tried to be executed , create table MyTable (id integer not null, name varchar(255), primary key (id)) type=MyISAM so you should try to execute that query directly on mysql command prompt to see if that works for your MySQL version.

Also, in question do specify your MySQL version too.

Hope it helps !!


You are using an updated version of MySQL but using and old dialect

Use either,

<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>

OR

<property name="hibernate.dialect">org.hibernate.dialect.MySQL8Dialect</property>

in the hibernate.cfg.xml file.

This prevents you from getting dialect issues.


The reason you are facing this error might be any of the reasons below:-

  • The column name in the DB Script and the model/entity class are different.
  • There is a spelling mistake in your configuration file while mentioning property value.
  • The MySQL version is not getting matched with the dialect that you are mentioning.

I was facing this error because I change the column names in my DATABASE SCRIPT but forgot to change it in the Model/Entity class. So, after 4 hours of pulling my hairs I simply did this and my application started running.