REVOKEpriv_type[(column_list)] [,priv_type[(column_list)]] ... ON {tbl_name| * | *.* |db_name.*} FROMuser[,user] ... REVOKE ALL PRIVILEGES, GRANT OPTION FROMuser[,user] ...
The REVOKE statement enables system
administrators to revoke privileges from MySQL accounts. To
use REVOKE, you must have the
GRANT OPTION privilege, and you must have
the privileges that you are revoking.
REVOKE is implemented in MySQL 3.22.11 or
later. For earlier MySQL versions, it does nothing.
Each account is named using the same format as for the
GRANT statement; for example,
'jeffrey'@'localhost'. If you specify only
the username part of the account name, a hostname part of
'%' is used. For additional information
about specifying account names, see Section 13.5.1.2, “GRANT Syntax”.
For details on the levels at which privileges exist, the
allowable priv_type values, and the
syntax for specifying users and passwords, see
Section 13.5.1.2, “GRANT Syntax”
If the grant tables hold privilege rows that contain
mixed-case database or table names and the
lower_case_table_names system variable is
set to a non-zero value, REVOKE cannot be
used to revoke these privileges. It will be necessary to
manipulate the grant tables directly.
(GRANT will not create such rows when
lower_case_table_names is set, but such
rows might have been created prior to setting the variable.)
To make it easy to revoke all privileges, MySQL 4.1.2 has added the following syntax, which drops all global, database-, table-, and column-level privileges for the named users:
REVOKE ALL PRIVILEGES, GRANT OPTION FROMuser[,user] ...
To use this REVOKE syntax, you must have
the UPDATE privilege for the
mysql database.
Before MySQL 4.1.2, all privileges cannot be dropped at once. Two statements are necessary:
REVOKE ALL PRIVILEGES ON *.* FROMuser[,user] ... REVOKE GRANT OPTION ON *.* FROMuser[,user] ...
REVOKE removes privileges, but does not
drop user table entries. You must do that
explicitly using DELETE. In MySQL 4.1.1 and
later, you can also use DROP USER to remove
users; see Section 13.5.1.1, “DROP USER Syntax”.

User Comments
Add your own comment.