hibernate create自动建立表异常问题

Hibernte中的hibernate.hbm2ddl.auto设置成create,让Hibernate帮助自动建表,但不成功,报以下信息:mysql

    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 1sql

    个人mysql 数据库是5.7版本的,因此要改变方言,由于:type=InnoDB在5.0之前是能够使用,但5.1以后就不行了。数据库

  若是把type=InnoDB改成engine=InnoDB就不会有这个问题。spa

可是想使用Hibernate,自动建表就须要将:hibernate

<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>server

改成:io

<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>error

相关文章
相关标签/搜索