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

后端 未结 7 1233
太阳男子
太阳男子 2020-12-29 06:08

I am a novice in hibernate world and facing,

WARN: GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
org.hibe         


        
相关标签:
7条回答
  • 2020-12-29 06:34

    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.

    0 讨论(0)
  • 2020-12-29 06:35

    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.

    0 讨论(0)
  • 2020-12-29 06:41

    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.

    0 讨论(0)
  • 2020-12-29 06:44

    Change in hibernate configuration XML file.

      <!-- SQL dialect -->      
      <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
    
    0 讨论(0)
  • 2020-12-29 06:51

    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 !!

    0 讨论(0)
  • 2020-12-29 06:53

    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.

    0 讨论(0)
提交回复
热议问题