MySQL非Root用户执行自定义Function的权限问题 execute command denied to user xxx... for routine xxx.xxxFunction

一般非root用户是没有创建和使用function的方法,一般都是root用户去创建自定义方法

而在项目中一般使用的都是非root用户

那调用自定义function就会报错:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: execute command denied to user 'xxx'@'%' for routine 'xxx.xxxFunction'

解决方法:

GRANT EXECUTE ON FUNCTION `db`.`function` TO 'user'@'%'

通过

show grants for 'user'@'%';

可查看赋予的权限

猜你喜欢

转载自blog.csdn.net/u013600907/article/details/105703834