转载请注明出处: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>

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

MySQL server version for the right syntax to use near &#39;type=InnoDB&#39; at line 1的更多相关文章

  1. MySQL server version for the right syntax to use near 'TYPE=MyISAM'

    最近将一个版本为4.0.18-Max的MySQL数据库迁移到5.6.20-enterprise-commercial-advanced上.好吧,这是我迄今为止,见到过的最古老版本的MySQL数据库,这 ...

  2. 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 7

    问题: 使用hibernate4.1.1,数据库使用mysql5.1.30,使用hibernate自动生成数据库表时,hibernate方言使用org.hibernate.dialect.MySQLI ...

  3. C# 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 ????

    有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...

  4. 遇到的check the manual that corresponds to your MySQL server version for the right syntax错误

    遇到的check the manual that corresponds to your MySQL server version for the right syntax错误. 结果发现是SQL关键 ...

  5. 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

    关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual ...

  6. MySQL遇到check the manual that corresponds to your MySQL server version for the right syntax错误

    用MySQL新建了一个Order表,插入了一条数据.总是显示 You have an error in your SQL syntax; check the manual thatcorrespond ...

  7. 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中如果字段使用了关键字,在插入和更新时会提示 You have an error in your SQL syntax; check the manual that corresponds ...

  8. MySQL server version for the right syntax to use near ‘USING BTREE

    转自:http://www.douban.com/note/157818842/ 有时导入mysql会提示如下错误: C:\Users\liqiang>mysql -uroot -paaaaaa ...

  9. MySQL check the manual that corresponds to your MySQL server version for the right syntax错误

    地化GO的时候一直遇到一个错误就是check the manual that corresponds to your MySQL server version for the right syntax ...

随机推荐

  1. passwd-shadow文件

    [root@rusky /]# vi /etc/passwd root:x:::Redhat5:/root:/bin/bash rusky:x::::/home/rusky:/bin/bash 1.r ...

  2. VMware Virtual Machine安装报错解决1

    安装完VMware virtual machine 后,再进行 "create a new virtual machine"最后点击"Finish"时,报如下错 ...

  3. python模块基础之getpass模块

    getpass模块提供了可移植的密码输入,一共包括下面两个函数: 1. getpass.getpass() 2. getpass.getuser() getpass.getpass([prompt[, ...

  4. for-of循环

    /* 1. 遍历数组 2. 遍历Set 3. 遍历Map 4. 遍历字符串 5. 遍历伪数组 6. 可迭代的对象 */var arr = [2,3,4];for(let ele of arr) { c ...

  5. asp.net "callback" 和 "postback" 的区别.

    下图解释了基于 asp.net的 "postback" 和 "callback"的生命周期: Postback 是在将 整个页面的数据 从 client 提交到 ...

  6. [Leetcode][021] Merge Two Sorted Lists (Java)

    题目在这里: https://leetcode.com/problems/merge-two-sorted-lists/ [标签]Linked List [题目分析]这个题目就是merge sort在 ...

  7. Java protobuf框架使用向导

    ProtoBuf,全称是Protocol Buffers, 它是谷歌内部用的一种高效的.可扩展的对结构化数据进行编码的格式规范.谷歌自己内部很多程序之间的通信协议都用了ProtoBuf. 下面介绍的是 ...

  8. Spring MVC异常处理

    Spring Mvc 中异常处理,一般有两种解决办法: 一.利用org.springframework.web.servlet.handler.SimpleMappingExceptionResolv ...

  9. jQuery Lazy Load 图片延迟加载

    基于 jQuery 的图片延迟加载插件,在用户滚动页面到图片之后才进行加载. 对于有较多的图片的网页,使用图片延迟加载,能有效的提高页面加载速度. 版本: jQuery v1.4.4+ jQuery ...

  10. php 二维数组按照某value值求出最大值最小值

    //商家的等级信息是一个二维数组,求出最小折扣和最大折扣array(0=>array('levelname'=>'银','dis'=>7.5), 1=>array('level ...