The GRANT and REVOKE statements allow system administrators to
create MySQL user accounts and to grant rights to and revoke them from
accounts.  GRANT and REVOKE are implemented in MySQL 3.22.11
or later. For earlier MySQL versions, these statements do nothing.

MySQL account information is stored in the tables of the mysql
database. This database and the access control system are discussed
extensively in [MySQL Database Administration], which you should consult
for additional details.

If the grant tables contain privilege records that contain mixed-case
database or table names and the lower_case_table_names system
variable is set, REVOKE cannot be used to revoke the privileges. It
will be necessary to manipulate the grant tables directly. (GRANT
will not create such records when lower_case_table_names is set,
but such records might have been created prior to setting the variable.)

Privileges can be granted at several levels:

   Global level
Global privileges apply to all databases on a given server. These privileges
are stored in the mysql.user table.
GRANT ALL ON *.* and
REVOKE ALL ON *.* grant and revoke only global privileges.

   Database level
Database privileges apply to all objects in a given database. These privileges
are stored in the mysql.db and mysql.host tables.
GRANT ALL ON db_name.* and
REVOKE ALL ON db_name.* grant and revoke only database privileges.

   Table level
Table privileges apply to all columns in a given table. These privileges are
stored in the mysql.tables_priv table.
GRANT ALL ON db_name.tbl_name and
REVOKE ALL ON db_name.tbl_name grant and revoke only table privileges.

   Column level
Column privileges apply to single columns in a given table. These privileges are
stored in the mysql.columns_priv table.
When using REVOKE, you must specify the same columns that were granted.

   Routine level
The CREATE ROUTINE, ALTER ROUTINE, EXECUTE, and
GRANT privileges apply to stored routines. They can be granted at the
global and database levels. Also, except for CREATE ROUTINE, these
privileges can be granted at the routine level for individual routines and
are stored in the mysql.procs_priv table.

  
