Allow a user to view stored procedures created by other users

2

I have a MySQL database populated with some stored procedures . The problem is that two different users have created several procedures, so that only the user who created the stored procedure can see its contents. In this context, I would like all two users to see all the procedures, that is, the ones that he created and the others created by the other user.

How would this be possible?

    
asked by anonymous 17.11.2014 / 16:56

1 answer

2

You need to give the permission (or privilege) EXECUTE for both users, on the procedures of each other.

The command GRANT can be executed in order to give permissions to execute of any routines of a database.

Example:

GRANT EXECUTE ON banco.* TO 'usuario'@'host';

In addition, for a user to see the code of a procedure created by another, it needs the SELECT privilege on the mysql.proc table. This can be found in the SHOW PROCEDURE CODE documentation.

In short, the listing of objects in a database or the code of a database is not always done through permissions directly related to the object. Therefore, check the privileges as SELECT in the MySQL control tables and tables in the current database.

    
17.11.2014 / 17:21