I am doing a procedure stored in MySQL that allows me to give certain permissions to the user that receives in the parameters, however, it does not assign them to the user that sent it by parameters when calling it, but, it creates a user with the same name as the parameter (in this case 'user') and assign the permissions to that user. How could I do to create such a procedure that allows me to give permissions to a user? Here the code of the procedure:
DELIMITER //
CREATE PROCEDURE tracker_system_db.administrador (IN usuario VARCHAR(20))
BEGIN
GRANT ALL PRIVILEGES ON tracker_system_db.* TO usuario;
flush PRIVILEGES;
END;
//