<tfoot id='YmIup'></tfoot>
    • <bdo id='YmIup'></bdo><ul id='YmIup'></ul>

      1. <small id='YmIup'></small><noframes id='YmIup'>

      2. <i id='YmIup'><tr id='YmIup'><dt id='YmIup'><q id='YmIup'><span id='YmIup'><b id='YmIup'><form id='YmIup'><ins id='YmIup'></ins><ul id='YmIup'></ul><sub id='YmIup'></sub></form><legend id='YmIup'></legend><bdo id='YmIup'><pre id='YmIup'><center id='YmIup'></center></pre></bdo></b><th id='YmIup'></th></span></q></dt></tr></i><div id='YmIup'><tfoot id='YmIup'></tfoot><dl id='YmIup'><fieldset id='YmIup'></fieldset></dl></div>

        <legend id='YmIup'><style id='YmIup'><dir id='YmIup'><q id='YmIup'></q></dir></style></legend>

        MySQL 存储过程权限

        时间:2023-10-26
            <tbody id='5kHsM'></tbody>
          <tfoot id='5kHsM'></tfoot>

            <small id='5kHsM'></small><noframes id='5kHsM'>

            • <i id='5kHsM'><tr id='5kHsM'><dt id='5kHsM'><q id='5kHsM'><span id='5kHsM'><b id='5kHsM'><form id='5kHsM'><ins id='5kHsM'></ins><ul id='5kHsM'></ul><sub id='5kHsM'></sub></form><legend id='5kHsM'></legend><bdo id='5kHsM'><pre id='5kHsM'><center id='5kHsM'></center></pre></bdo></b><th id='5kHsM'></th></span></q></dt></tr></i><div id='5kHsM'><tfoot id='5kHsM'></tfoot><dl id='5kHsM'><fieldset id='5kHsM'></fieldset></dl></div>

            • <legend id='5kHsM'><style id='5kHsM'><dir id='5kHsM'><q id='5kHsM'></q></dir></style></legend>

                  <bdo id='5kHsM'></bdo><ul id='5kHsM'></ul>
                  本文介绍了MySQL 存储过程权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试图授予用户在 MySQL 数据库上的存储过程级别运行存储过程的权限,而不是允许用户执行数据库中的任何存储过程.我试图执行以下代码:

                  I am trying to give a user permission to run a stored procedure at the stored procedure level on a MySQL Database rather than allowing a user to execute any stored procedure in the database. I was trying to execute the following code:

                  GRANT EXECUTE ON myDB.spName TO 'TestUser'@'localhost';
                  

                  但我不断收到以下错误:

                  非法的 GRANT/REVOKE 命令,请查阅手册以了解可以使用哪些权限.

                  But i keep getting the following error:

                  Illegal GRANT/REVOKE command, please consult the manual to see which privileges can be used.

                  我尝试将其更改为以下内容:

                  I tried changing it to the following:

                  GRANT EXECUTE ON PROCEDURE myDB.spName TO 'TestUser'@'localhost';
                  

                  并且我收到一个不同的错误说明:

                  无法在用户表中找到任何匹配的行.

                  And i get a different error stating:

                  Cant find any matching rows in the user table.

                  我不知道哪里出错了?

                  同样在 MySQL Workbench 上,我似乎看不到任何通过 GUI 在存储过程级别授予权限的方法.这是正确的还是我遗漏了什么?

                  Also on the MySQL Workbench I can not seem to see any way to grant permissions at the stored procedure level via the GUI. Is this correct or am I missing something?

                  提前致谢.

                  推荐答案

                  您的第二次尝试是正确的方法:

                  Your second attempt is the right approach:

                  GRANT EXECUTE ON PROCEDURE myDB.spName TO 'TestUser'@'localhost';
                  

                  但如果这不起作用,请验证...

                  but if that is not working, verify ...

                  a) 您(您从中运行所有这些命令的用户)拥有授予权限[即具有授予选项].如果您是根用户,那么您就拥有授予权限.

                  a) you (the user from which you are running all these command) have grant rights [i.e WITH GRANT OPTION]. If you are root, then you have grant rights.

                  b) 您授予执行权限的用户存在,例如

                  b) the user exists to which you are granting execute permission e.g.

                   select user from mysql.user where user  like  'test%';
                  

                  如果没有,则创建用户,例如

                  If not, then create the user e.g.

                  CREATE USER 'TestUser'@'localhost' IDENTIFIED BY 'passwordxxxx';
                  #depending on your needs
                  GRANT SELECT,DELETE,UPDATE PRIVILEGES ON myDb.* TO 'TestUser'@'localhost'; 
                  

                  希望这有帮助:)

                  这篇关于MySQL 存储过程权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 SQL Developer 中运行存储过程? 下一篇:MySQL 将 EXECUTE 的结果保存在变量中?

                  相关文章

                  <tfoot id='4QEBR'></tfoot>
                  1. <legend id='4QEBR'><style id='4QEBR'><dir id='4QEBR'><q id='4QEBR'></q></dir></style></legend>
                    <i id='4QEBR'><tr id='4QEBR'><dt id='4QEBR'><q id='4QEBR'><span id='4QEBR'><b id='4QEBR'><form id='4QEBR'><ins id='4QEBR'></ins><ul id='4QEBR'></ul><sub id='4QEBR'></sub></form><legend id='4QEBR'></legend><bdo id='4QEBR'><pre id='4QEBR'><center id='4QEBR'></center></pre></bdo></b><th id='4QEBR'></th></span></q></dt></tr></i><div id='4QEBR'><tfoot id='4QEBR'></tfoot><dl id='4QEBR'><fieldset id='4QEBR'></fieldset></dl></div>
                      <bdo id='4QEBR'></bdo><ul id='4QEBR'></ul>

                      <small id='4QEBR'></small><noframes id='4QEBR'>