📜 ⬆️ ⬇️

Access to MySQL stored procedure bodies

A couple of times I encountered an error when calling stored procedures:
User doesn’t have access to the metadata procedure. If you can’t get it, then you’ll be able to identify the parameters that constitute the INOUT strings irregardless of actual parameter types.

The solution proposed in the exception text is to use the noAccessToProcedureBodies parameter in the connection string (disable access), but I was wondering how to give access to the procedure bodies.
It is characteristic that in the text of the above error there is a huge number of links, most of which describe how to correctly write the parameter in the connection URL.
And the solution turned out to be very simple: all procedures are stored in the `mysql`.`proc` table, respectively, you just need to execute the command:

GRANT SELECT ON `mysql`.`proc` to 'myuser'@'myhost';

It is a little unexpected, because out of habit you think that GRANT ALL already had to decide everything.

')

Source: https://habr.com/ru/post/148983/


All Articles