Mybatis调用存储过程
贴码
1 | Error querying database. Cause: java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types. |
总结
跟着这个错误在网上找了一下,原来是该用户没有调用存储过程的权限,所以只要赋予proc的权限即可,亲测成功。在MySql中执行如下命令,授予权限。(user@host 是连接数据库的用户名,修改成连接数据库的用户名就行)
grant select on mysql.proc to user@host;
flush privileges;