Springboot mysql访问异常:User does not have access to metadata required to determine stored procedure

 

错误信息:

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.

场景:

Springboot通过mybtis调用权限控制严格的mysql存储过程出现此异常。

原因:

当前账号没有对表mysql.proc的select权限或没有show create procudure权限

解决方式:

第一种: springboot代码中的jdbc连接url配置上"&noAccessToProcedureBodies=true";

第二种:使用mysql数据库管理员账号对普通账号授予相应的权限:GRANT SELECT ON mysql.proc TO 'user'@'%';

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章