English 中文(简体)
MySQL 储存程序
原标题:MySQL Stored Procedure Permissions

我试图允许用户在MySQL数据库储存的程序水平上操作一个存储程序,而不是允许用户执行数据库中的任何储存程序。 我正在努力执行以下法典:

GRANT EXECUTE ON myDB.spName TO  TestUser @ localhost ;

但是,如果保留以下错误:
<>>>>>>> 编码>。

我试图将其改为:

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

而一则有不同的错误,称:

>>>

我被混为一谈,我是错了吗?

另外,在MySQL Workbench,我似乎看不到通过GUI获得储存程序许可的任何办法。 这是正确的,还是我失踪了吗?

提前感谢。

最佳回答

您的第二个尝试是正确的做法:

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

但如果这项工作不可行,则核实......

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) 用户是您颁发执行许可的用户。

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

否则,就会产生用户。

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

希望:

问题回答

为了回答你关于MySQL Workbench问题的另一方面,我也持有同样的问题。 但是,在试验后,我发现,如果你起作用,打开在底层提出的特权,那么你就可以将例行公事从《示范公约》概述拖到目标箱。 在那儿,我只点击新添加的物体,并加上你希望发挥这一作用的许可。

希望:

我发现这部法典: 储存程序的许可

USE [Database];   

GRANT EXECUTE ON OBJECT::[dbo].[your stored procedure]
    TO databaseUser; 

页: 1





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...