MySQL server version for the right syntax to use near 'type=InnoDB' at line 1


           转载请注明出处:http://blog.csdn.net/bettarwang/article/details/40180271

       在执行一个Hibernate的演示样例时,配置了<property name="hibernate.hbm2ddl.auto">update</property>属性,可是自己主动建表却一直不成功,出错信息为:

        ERROR: HHH000388: Unsuccessful: create table info_table (id integer not null auto_increment, title varchar(255), content varchar(255), primary key (id)) type=InnoDB

        ERROR: 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的版本号问题导致的,实际上,在MySQL5.0曾经,type=InnoDB是有效的SQL语句,可是自己用的是MySQL5.5版本号,type=InnoDB不再有效了。

       解决的方法就是改动hibernate.cfg.xml中的dialect属性,将

  <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>改动为

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

      再次执行,发现能够自己主动建表了。










免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 关于...corresponds to your MySQL server version for the right syntax to use near '?' at line 1的解决办法 check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '123456' WITH GRANT OPTION' at line 1 错误:MySQL server version for the right syntax to use near Django进行数据迁移时,报错:(1064, "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 '(6) NOT NULL)' at line 1") 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 '"id", ERROR 1064 (42000): 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 Mysql语法错误之> 1064 - 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' MySql 执行语句错误 Err] 1064 - 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 解决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 'order (order_name, customer) mybatis批量更新update-设置多个字段值 报错 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
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM