REVOKE
Last Updated:2021-04-13
REVOKE
Description
Used to revoke specified privileges of specified user or role.
Revoke the privileges on libraries and tables:
REVOKE privilege_list
ON db_name[.tbl_name]
FROM user_identity [ROLE role_name]
Revoke the privileges on resources:
REVOKE privilege_list
ON RESOURCE resource_name
FROM user_identity [ROLE role_name]
-
user_identity
The
user_identity
syntax here is the same as the syntax inCREATE USER
and must be theuser_identity
created by usingCREATE USER
. Thehost
inuser_identity
can be a domain name. If it is a domain name, the revoke time of privilege may be delayed for about 1min.
The privilege of specified ROLE can also be revoked, and the ROLE executed must exist.
Example
-
Revoke the privilege of user jack on database testDb
REVOKE SELECT_PRIV ON db1.* FROM 'jack'@'192.%';
-
Revoke the privilege of user jack on resource odbc_resource
REVOKE USAGE_PRIV ON RESOURCE 'odbc_resource' FROM 'jack'@'192.%';
Keywords
REVOKE