REVOKE

Overview

Removes privileges granted to a user account or security role.

USAGE

Common Syntax:

REVOKE <privilege_type> [, <privilege_type>] ...
   ON {<privilege_target_name>
   | TABLE <tbl_name>
   | FUNCTION <func_name>
   | PROCEDURE <proc_name>}
FROM <user_name> [@ <host_name>] [, <user_name> [@ <host_name>] ] ...

REVOKE ALL PRIVILEGES, GRANT OPTION
   FROM <user_name> [@ <host_name>] [, <user_name> [@ <host_name>] ] ...

DETAILS

MariaDB Xpand's REVOKE statement has some differences from MariaDB Enterprise Server:

  • The user account can't be specified using CURRENT_USER, CURRENT_USER(), or SESSION_USER()

  • The _ and % wildcards are not supported in database name specifications

  • Values supplied for column_list and object_type are ignored

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

Revoke Specific Privileges

Let's create a new user and grant privileges for a specific database:

CREATE USER usr1;
GRANT SELECT, INSERT, UPDATE, DELETE
   ON db1.*
   TO 'usr1'@'%';
SHOW GRANTS FOR usr1\G
*************************** 1. row ***************************
Grants for usr1@%: GRANT DELETE, INSERT, SELECT, UPDATE ON `db1`.* TO 'usr1'@'%'

To revoke a specific set of privileges for a database:

REVOKE INSERT, UPDATE, DELETE
   ON db1.*
   FROM 'usr1'@'%';
SHOW GRANTS FOR usr1\G
*************************** 1. row ***************************
Grants for usr1@%: GRANT SELECT ON `db1`.* TO 'usr1'@'%'

Revoke All Privileges

To revoke all privileges from a user:

REVOKE ALL PRIVILEGES, GRANT OPTION
   FROM 'usr1'@'%';
SHOW GRANTS FOR usr1\G
*************************** 1. row ***************************
Grants for usr1@%: GRANT USAGE ON *.* TO 'usr1'@'%'

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES