关于hibernate.hbm2ddl.auto为update时无法在数据库自动创建表

问题:

org.hibernate.exception.SQLGrammarException: could not insert: [cn.itcast.entity.User]

Caused by: java.sql.SQLSyntaxErrorException: Table 'hib_demo.user' doesn't exist

原因:mysql数据库中已存在已由其他数据库存在这张表,所以无法使用update自动建表

解决方案1:删除其他库的这张表

解决方案2:使用create进行自动建表

原文地址:https://www.cnblogs.com/e-x-c-e-ption/p/11590149.html