问题描述
在使用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:
如果我手动删除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表创建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!