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>
再次执行,发现能够自己主动建表了。
MySQL server version for the right syntax to use near 'type=InnoDB' at line 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数据库,这 ...
- 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 ...
- 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 ...
- 遇到的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关键 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- c# winform InvokeRequired 解决跨线程访问控件
C#中禁止跨线程直接访问控件,InvokeRequired是为了解决这个问题而产生的,当一个控件的InvokeRequired属性值为真时,说明有一个创建它以外的线程想访问它. Windows 窗体中 ...
- 解决操作过快导致ajax异常的办法
//控制点击过快ajax异常 var state = true; function test() { if (state) { state = false; var val = accMul((uCo ...
- LINQ更新用户
public Boolean UpdateUser(int id, string userName, string account, string password, string EkeyID, ...
- C语言学习笔记---谭浩强
前段时间有机会去面试了一次,真是备受“打击”(其实是启发),总的来说就是让我意识到了学习工具和学习技术的区别.所以最近在看一些数据结构和算法,操作系统,python中的并行编程与异步编程等东西.然而数 ...
- (转)回车 执行button点击
功能说明:当我们注册或者执行搜索时,输入内容后,不用单击按钮来执行按钮单击事件,而直接通过回车来执行按钮单击事件.只要在text框中onkeydown事件中加入执行按钮的onclick事件就OK了 代 ...
- Cordova自定义插件
项目原因需要自定义Cordova插件,下面把实现过程记录以便将来查阅.工程为Eclipse下的Android工程,该工程已经引入Cordova.Cordova版本4.0.2.1.定义插件类OpenAp ...
- javascript div元素后追加节点
例子解释: 这段代码创建新的 <p> 元素: var para=document.createElement("p"); 如需向 <p> 元素添加文本,您必 ...
- MyEclipse笔记(2):debug的使用
对于程序代码而言,学会调debug是重中之重,依此,掌握该技巧 以算1到50的和的代码为例: package com.front.action; public class debug { public ...
- 关于ajax直接提交表单jQuery .validator验证不起作用问题
之前用$.ajax(function(){});直接提交表单,而表单验证不通过也能提交. $(document).ready(function(){ $.ajax({ url:" ...
- centos 安装,配置memcached
先查看是否已经安装了memcached输入memcached -h会输出memcached版本,或print phpinfo查看: memcached需要libevent支持,没有libevent,就 ...