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?
To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name. * TO 'username'@'localhost';
To grant permissions on a stored procedureExpand Stored Procedures, right-click the procedure to grant permissions on, and then select Properties. From Stored Procedure Properties, select the Permissions page. To grant permissions to a user, database role, or application role, select Search.
The syntax for granting EXECUTE privileges on a function/procedure in MySQL is: GRANT EXECUTE ON [ PROCEDURE | FUNCTION ] object TO user; EXECUTE. The ability to execute the function or procedure.
Use this instead, it will work:
GRANT EXECUTE ON mydb.* TO 'my_user'@'%';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With