I am a novice in hibernate world and facing,
WARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
org.hibe
I ran into the same problem. And indeed, it is the dialect issue, although none of the options provided by Sabir helped me out (with due respect) but changing it from MySQL5Dialect to MySQL8Dialect helped me resolve the issue.
So if none of the above 3 options provided above works, go for MySQL8Dialect.
Hope this will help.
Check your property value mistakes.
It happens sometime, when you just simply forget the 't' in Dialec, which has to be Dialect, simply spelling mistake or value kind of mistake there is inside your configuration.
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.
Change in hibernate configuration XML file.
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
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 !!
The reason you are facing this error might be any of the reasons below:-
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.