The user specified as a definer ('root'@'%') does not exist 墨蓝 2022-06-18 02:13 106阅读 0赞 当对数据库进行操作的时候,会遇到root无操作权限问题。 一般会提示如下: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)....... Caused by: java.sql.BatchUpdateException: The user specified as a definer ('root'@'%') does not exist at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443)......... 要做的就是将所有sql权限赋予root。两个步骤即可解决: 1、 grant all privileges on \*.\* to root@"%" identified by "."; Query OK, 0 rows affected (0.11 sec) 2、flush privileges; Query OK, 0 rows affected (0.08 sec) 具体操作见下图: ![Center][] 权限已经授权完毕。 [Center]: /images/20220618/cbe14cc4c27c4b3db3483a6ee923a6cf.png
还没有评论,来说两句吧...