在本地调用时,出现以下错误:
User does not have access to metadata required to determine storedprocedure parameter types. If rights can not be granted, configureconnection with "noAccessToProcedureBodies=true" to have drivergenerate parameters that represent INOUT strings irregardless of actualparameter types.
1.确保权限
解决办法是进行权限赋值
以root用户登陆将mysql.proc的表赋给相应的调用用户
GRANT SELECT, INSERT, UPDATE ON `mysql`.`proc` TO 'syzj'@'localhost';
赋权后问题解决。
在此记录一下。
2.url连接加入&noAccessToProcedureBodies=true
控制台显示Mysql错误:"User does not have access to metadata required to determine stored procedure parameter types. ...... "。网上说在数据源配置的url里,加上"&noAccessToProcedureBodies=true"就可以了。我试了试,控制台又提示说:"The user specified as a definer('username'@'%') does not exist"。这个用户当时赋予权限时,是username@localhost,改为username@%就好了。
参考:

本文详细记录了解决MySQL中用户无法访问存储过程元数据以确定参数类型的权限问题,通过为用户分配必要的权限或在URL连接中添加特定参数来解决。包括通过root用户将权限赋给调用用户、在数据源配置中使用&noAccessToProcedureBodies=true,以及调整权限设置以避免错误提示。
548

被折叠的 条评论
为什么被折叠?



