Search code examples
mysqlsqlmysql-workbenchprivileges

Error granting permissions


I'm using MySQL Workbench, and MySQL 5.6.

I am trying to create a user that can only execute stored proceedures.

So I created a user, gave a password and gave the role 'routine.execute'.

It generates this:

CREATE USER 'serveruser' IDENTIFIED BY 'PASSWORD';

GRANT EXECUTE ON ROUTINE `myschema`.* TO 'serveruser';

And that generates this error:

Executing SQL script in server

ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`myschema`.* TO 'serveruser'' at line 1





GRANT EXECUTE ON ROUTINE `myschema`.* TO 'serveruser'



SQL script execution finished: statements: 228 succeeded, 1 failed

However, if I select any other role, like owner or table.insert, it goes through just fine.


Solution

  • Try changing to:

    GRANT EXECUTE ON PROCEDURE `myschema`.* TO 'serveruser'