gpt4 book ai didi

mysql - Spring 与 mySql

转载 作者:行者123 更新时间:2023-11-29 10:57:59 25 4
gpt4 key购买 nike

我的伙伴有相同的代码,但我是唯一遇到此问题的人。我有相同的 mySql 和 Spring 版本。这是我得到的异常:

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'dataBaseUsage': Invocation of init method failed;
nested exception is
org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute statement; SQL [n/a]; nested exception is
org.hibernate.exception.SQLGrammarException: could not execute statement

Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute statement; SQL [n/a]; nested exception is
org.hibernate.exception.SQLGrammarException: could not execute statement

Caused by: org.hibernate.exception.SQLGrammarException:
could not execute statement

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Unknown column 'roles' in 'field list'

DataBaseUsage是@Controller

谢谢

最佳答案

您只是在数据库表中没有列roles。您应该更新您的数据库。您可以使用hibernate.hbm2ddl.auto=update

关于mysql - Spring 与 mySql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42739905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com