Name
REVOKE
Synopsis
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user[, . . . ] REVOKEprivileges[(column, . . . )] ONtable.databaseFROMuser[, . . . ]
Use this statement to revoke all or
certain privileges that were granted to a user with the
GRANT statement. The first syntax structure is
used to revoke all privileges from a user. Multiple users may be
given in a comma-separated list. A list of users and their privileges
are stored in the mysql database, in particular
in the user table.
To revoke only some privileges, you can use the second syntax
structure. The specific privileges are to be given in a
comma-separated list after the keyword REVOKE. To
revoke privileges for specific columns, those columns may be listed
within parentheses in a comma-separated list. Privileges that are
granted based on columns are stored in the
columns_priv table of the
mysql database. Privileges may be revoked on a
specific table for a specific database. To revoke privileges on all
tables of a database, the table name should be substituted with an
asterisk as a wildcard. You can do the same for the database name for
the statement to apply to all databases. Table-specific privileges
are stored in the tables_priv table, and
database privileges are stored in the db table.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access