问题
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