错误信息:
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 8
解决:
发现是因为type=InnoDB在5.0以前是可以使用的,但5.1之后就不行了。如果我们把type=InnoDB改为engine=InnoDB就不会有这个问题。如果用Hibernate,自动帮我建表。只需要修改配置:hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect修改为:hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect