How to grant a user access to all stored procedures on mysql?

白昼怎懂夜的黑 提交于 2020-12-26 06:22:24

问题


I'm trying the following:

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

but I get the error:

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

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?


回答1:


Use this instead, it will work:

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


来源:https://stackoverflow.com/questions/35302777/how-to-grant-a-user-access-to-all-stored-procedures-on-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!