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'@'%';

 

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