MySQL 5.5.9和TYPE上的Hibernate表创建错误 [英] MySQL 5.5.9 and Hibernate table creation error on TYPE

查看:105
本文介绍了MySQL 5.5.9和TYPE上的Hibernate表创建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Hibernate + Spring重新创建数据库时,生成的SQL在每个创建语句的末尾附加type = InnoDB>。这似乎会导致我的MySQL5.5.9安装程序出现问题。它会产生以下错误:

While trying to recreate my database using Hibernate + Spring, the SQL that get's generated appends "type=InnoDB" to the end of each creation statement. This seems to cause problems with my MySQL5.5.9 setup. It produces the following error:


您的SQL语法错误;检查与您的MySQL服务器版本相对应的手册,在第1行'type = InnoDB'附近使用正确的语法

如果我手动删除type = InnoBD并在MySQL中粘贴create命令,它工作正常。

If I manually remove the type=InnoBD and paste the create command in MySQL, it works fine.

有其他人遇到此错误吗?这可能只是一个MySQL设置,我需要改变?我将 my-innodb-heavy-4G.cnf 模板用作我的 /etc/my.cnf

Has someone else come across this error? Is it maybe just a MySQL setting that I need to change? I am using the my-innodb-heavy-4G.cnf template as my /etc/my.cnf.

我也知道类型语法已被MySQL弃用,并且 engine 应该被使用(并且如果我手动修改create语句的话)。有没有什么办法可以在Hibernate中配置它?

I also know that the type syntax has been deprecated by MySQL, and that engine should be used (and it does if I manually alter the create statements). Is there any way to configure this in Hibernate?

谢谢

Thanks

推荐答案

使用 MySQL5InnoDBDialect 而不是 MySQLInnoDBDialect

这篇关于MySQL 5.5.9和TYPE上的Hibernate表创建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆