snippetsqlMinor
Permissions for mysql 'SHOW CREATE PROCEDURE'?
Viewed 0 times
showpermissionscreateproceduremysqlfor
Problem
I'm working on creating a 'read-only' mysql database. I want the user to be able to see everything, but not be able to modify anything. My user currently has the following grants:
I can see stored procedures, but if I run:
The 'Create procedure' column returns null. Is there a way I can allow a read-only user to see the creation procedure without being able to modify it?
GRANT USAGE ON . TO 'sqlprostudio-ro'@'%' IDENTIFIED BY PASSWORD '*x'
GRANT SELECT, EXECUTE, SHOW VIEW ON northwind.* TO 'sqlprostudio-ro'@'%'I can see stored procedures, but if I run:
SHOW CREATE PROCEDURE xThe 'Create procedure' column returns null. Is there a way I can allow a read-only user to see the creation procedure without being able to modify it?
Solution
the second line in man says:
To use either statement, you must be the user named in the routine DEFINER clause or have SELECT access to the mysql.proc table. If you do not have privileges for the routine itself, the value displayed for the Create Procedure or Create Function field will be NULL.
The other option (just a suggestion) you may design a procedure or function (preferable) to show the info in question.
Regards,
To use either statement, you must be the user named in the routine DEFINER clause or have SELECT access to the mysql.proc table. If you do not have privileges for the routine itself, the value displayed for the Create Procedure or Create Function field will be NULL.
The other option (just a suggestion) you may design a procedure or function (preferable) to show the info in question.
Regards,
Context
StackExchange Database Administrators Q#184724, answer score: 5
Revisions (0)
No revisions yet.