简体   繁体   English

如何授予受限用户查看 mysql 例程的结构?

[英]How can I grant to the limited users to see the structure of mysql routines?

How can I grant somebody to see the structure of mysql routines?我怎样才能让别人看到 mysql 例程的结构? The following command can be used to show the structure of routines:以下命令可用于显示例程的结构:

show create function FUNCTION_NAME

or或者

show create procedure PROCEDURE_NAME

but It should be run by the user with grant all permission.但它应该由grant all权限的用户运行。 I don't want to give grant all to the user .我不想将grant all user What is the exact grant I need or what is the alternative solutions?我需要的确切拨款是什么或替代解决方案是什么?

from the manual手册

To use either statement, you must be the user named in the routine DEFINER clause or have SELECT access to the mysql.proc table.要使用任一语句,您必须是例程 DEFINER 子句中指定的用户或对 mysql.proc 表具有 SELECT 访问权限。

So granting SELECT to the mysql.proc table should be sufficient.因此,将SELECT授予mysql.proc表就​​足够了。

For MySQL 8.20+ you can use:对于 MySQL 8.20+,您可以使用:

GRANT SHOW_ROUTINE ON . TO username

MySQL 8 Reference MySQL 8 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM