[踩坑记录][hibernate]Table 'XXX' doesn't exist 解决办法

时间:2021-12-26 22:46:46
准备重新捡起hibernate,开始重新新建个demo的时候发现老是报错 :
报错提示:
org.hibernate.exception.SQLGrammarException: could not execute statement
......
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table
'hibernate.students' doesn't exist
......
原因很清楚,但很莫名其妙,不存在student这个表 (黑人问号???)


解决办法:hibernate.cfg.xml 中修改
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

<property name="dialect">org.hibernate.dialect.MySQLDBDialect</property>