hibernate自動キー表報MySQL server version for the right syntax to use near'type=InnoDB'at line 1

899 ワード

hibernateでテーブルを自動的に生成すると、次のエラーが表示されます.
    [ERROR][2016-07-05 14:42:00] org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:213) 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=InnoDB' at line 1 
作業中にsql文を使用してテーブルを作成すると、次のエラーが発生します.
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=InnoDB' at line 1
二、解決方案:
このエラーは、一部のバージョンのmysqlがtypeの書き方をサポートしていないため、typeキーワードをENGINEに変更すればよい.
ヒバーナートの方言に問題があるに違いない
org.hibernate.dialect.MySQLInnoDBDialect(mysql5.0    )
から
org.hibernate.dialect.MySQL5InnoDBDialect(mysq5.1-5.5)

あるいは直接書く
org.hibernate.dialect.MySQLDialect