Let's look at some examples of how to grant EXECUTE privileges on a procedure in MySQL.įor example, if you had a procedure called MyFirstProc and you wanted to grant EXECUTE access to the user named smithj, you would run the following GRANT statement: GRANT EXECUTE ON PROCEDURE MyFirstProc TO you wanted to grant ALL users the ability to EXECUTE this procedure, you would run the following GRANT statement: GRANT EXECUTE ON PROCEDURE MyFirstProc TO Privileges on Functions/Procedures Let's look at some examples of how to grant EXECUTE privileges on a function in MySQL.įor example, if you had a function called CalcIncome and you wanted to grant EXECUTE access to the user named smithj, you would run the following GRANT statement: GRANT EXECUTE ON FUNCTION CalcIncome TO you wanted to grant ALL users the ability to EXECUTE this function, you would run the following GRANT statement: GRANT EXECUTE ON FUNCTION CalcIncome TO Example - Procedure user The name of the user that will be granted the EXECUTE privileges. In the case of granting EXECUTE privileges on a function or procedure, this would be the function name or the procedure name. object The name of the database object that you are granting privileges for. FUNCTION It is used when the privilege is being granted on a function in MySQL. PROCEDURE It is used when the privilege is being granted on a procedure in MySQL. The syntax for granting EXECUTE privileges on a function/procedure in MySQL is: GRANT EXECUTE ON object TO user EXECUTE The ability to execute the function or procedure. When dealing with functions and procedures, you can grant users the ability to EXECUTE these functions and procedures in MySQL. Let's look at some examples of how to revoke privileges on tables in MySQL.įor example, if you wanted to revoke DELETE and UPDATE privileges on a table called contacts from a user named smithj, you would run the following REVOKE statement: REVOKE DELETE, UPDATE ON contacts FROM you wanted to revoke all permissions (except GRANT OPTION) on a table for a user named smithj, you could use the ALL keyword as follows: REVOKE ALL ON contacts FROM you had granted SELECT privileges to * (ie: all users) on the contacts table and you wanted to revoke these privileges, you could run the following REVOKE statement: REVOKE SELECT ON contacts FROM Privileges on Functions/Procedures user The name of the user that will have these privileges revoked. In the case of revoking privileges on a table, this would be the table name. Object The name of the database object that you are revoking privileges for. For example: GRANT SELECT ON contacts TO to perform SELECT statements on the table. For example: GRANT ALL ON contacts TO you wanted to grant only SELECT access on the contacts table to all users, you could grant the privileges to *. Let's look at some examples of how to grant privileges on tables in MySQL.įor example, if you wanted to grant SELECT, INSERT, UPDATE, and DELETE privileges on a table called contacts to a user name smithj, you would run the following GRANT statement: GRANT SELECT, INSERT, UPDATE, DELETE ON contacts TO can also use the ALL keyword to indicate that you wish to grant all permissions except GRANT OPTION to a user named smithj. user The name of the user that will be granted these privileges. In the case of granting privileges on a table, this would be the table name. Object The name of the database object that you are granting permissions for. Grants all permissions except GRANT OPTION. Ability to perform SELECT statements on the table.Ībility to perform INSERT statements on the table.Ībility to perform UPDATE statements on the table.Ībility to perform DELETE statements on the table.Ībility to create an index on an existing table.Ībility to perform CREATE TABLE statements.Ībility to perform ALTER TABLE statements to change the table definition.Ībility to perform DROP TABLE statements.Īllows you to grant the privileges that you possess to other users.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |