如何授予用户访问 mysql 上所有存储过程的权限? [英] How to grant a user access to all stored procedures on mysql?

查看:66
本文介绍了如何授予用户访问 mysql 上所有存储过程的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以下操作:

DROP USER IF EXISTS 'my_user'@'%';
CREATE USER 'my_user'@'%' IDENTIFIED BY 'my_pwd';
GRANT EXECUTE ON PROCEDURE mydb.* TO 'my_user'@'%';

但我收到错误:

Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used 0.000 sec

如果我明确命名一个过程:

If I name a proc explicitly:

DROP USER IF EXISTS 'my_user'@'%';
CREATE USER 'my_user'@'%' IDENTIFIED BY 'my_pwd';
GRANT EXECUTE ON PROCEDURE mydb.my_proc TO 'my_user'@'%';

然后它工作正常,但我想允许用户帐户访问数据库上的每个 proc,是否可以在不明确授予每个单独 proc 权限的情况下执行此操作?

then it works fine, but I want to allow the user account to have access to every proc on the db, is there anyway to do this without explicitly granting permission to every individual proc?

推荐答案

改用这个,它会起作用:

Use this instead, it will work:

GRANT EXECUTE ON mydb.* TO 'my_user'@'%';

这篇关于如何授予用户访问 mysql 上所有存储过程的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆