Hibernate与Mysql 5.5创建表出错--table doesn't exist
来源:互联网 发布:有了源码怎么架设游戏 编辑:程序博客网 时间:2024/06/06 04:13
最近在学习hibernate,利用其自动创建表时老是出错,出错信息如下:
ERROR: HHH000388: Unsuccessful: create table NEWS (ID integer not null auto_increment, TITLE varchar(255), AUTHOR varchar(255), DATE date, primary key (ID)) type=InnoDB2015-12-24 13:50:38 org.hibernate.tool.hbm2ddl.SchemaUpdate executeERROR: 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 72015-12-24 13:50:38 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
经过分析,可以看出提示在type=InnoDB这里出错,将hibernate自动生成的建表语句
create table NEWS (ID integer not null auto_increment, TITLE varchar(255), AUTHOR varchar(255), DATE date, primary key (ID)) type=InnoDB
在mysql下运行同样报错,经查资料发现是这么一回事:
在mysql 5.0版本以后不支持 type=InnoDB 关键字,需要使用 engine=InnoDB
解决放下如下:
在hinernate.cfg.xml配置文件中修改本地方言即可:
<!--原来用的是MySQLInnoDBDialect,改为MySQL5Dialect即可--><!-- <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> --><property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
0 0
- Hibernate与Mysql 5.5创建表出错--table doesn't exist
- 使用Mysql 5.5数据库Hibernate自动建表创建表出错table doesn't exist
- Hibernate创建数据表出错:table doesn't exist
- 【Hibernate】Table '表名' doesn't exist
- Mysql table '' doesn`t exist
- ERROR JDBCExceptionReporter:234 - Table 'xxxxxxxx' doesn't exist hibernate无法自动创建表
- [新手]hibernate 表不存在 MySQLSyntaxErrorException: Table doesn't exist
- hibernate不能自动建表:MySQLSyntaxErrorException: Table '' doesn't exist
- hibernate---Table 'XXX.XXX' doesn't exist
- Hibernate ERROR: Table doesn't exist
- Mysql “Table 'mysql.servers' doesn't exist”
- 数据库备份 Mysql table '' doesn`t exist
- mysql Table 'performance_schema.session_variables' doesn't exist
- mysql Table 'performance_schema.session_status' doesn't exist
- Table ‘phpmyadmin.pma_table_uiprefs’ doesn’t exist mysql
- table 'mysql.proc' doesn't exist问题解决
- Table'mysql.proc' doesn't exist和Table 'mysql.event'doesn't exist警告
- Mysql 升级重装后连接出错 Table \'performance_schema.session_variables\' doesn\'t exist
- MacOS10.11 brew无法使用解决办法
- frame和bounds的区别
- Xcode实时渲染——@IBDesignable
- Codeforces 609B The Best Gift 【水题】
- HIBERNATE 的乐观锁@VERSION和 MYSQL 的两个小问题
- Hibernate与Mysql 5.5创建表出错--table doesn't exist
- Ant+jmeter配置
- Android之.XML布局
- MmGetSystemRoutineAddress和MiFindExportedRoutineByName函数的实现代码
- stat函数讲解
- CSS3:伪对象选择器
- Zlib库的使用实现对zip文件的解压缩(二)
- 新浪实时股票数据接口http://hq.sinajs.cn/list=code
- Android Studio界面介绍