MySQL Stored Procedure Permissions

Your second attempt is the right approach:

GRANT EXECUTE ON PROCEDURE myDB.spName TO 'TestUser'@'localhost';

but if that is not working, verify …

a) you (the user from which you are running all these command) have grant rights
[i.e WITH GRANT OPTION]. If you are root, then you have grant rights.

b) the user exists to which you are granting execute permission e.g.

 select user from mysql.user where user  like  'test%';

If not, then create the user e.g.

CREATE USER 'TestUser'@'localhost' IDENTIFIED BY 'passwordxxxx';
#depending on your needs
GRANT SELECT,DELETE,UPDATE PRIVILEGES ON myDb.* TO 'TestUser'@'localhost'; 

Hope this helps 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)