Syntax:
GRANT priv_type [(column_list)] [, priv_type [(column_list)]] ...
    ON {tbl_name | * | *.* | db_name.*}
    TO user [IDENTIFIED BY [PASSWORD] 'password']
        [, user [IDENTIFIED BY [PASSWORD] 'password']] ...
    [REQUIRE
        NONE |
        [{SSL| X509}]
        [CIPHER 'cipher' [AND]]
        [ISSUER 'issuer' [AND]]
        [SUBJECT 'subject']]
    [WITH with_option [with_option] ...]

with_option =
    GRANT OPTION
  | MAX_QUERIES_PER_HOUR count
  | MAX_UPDATES_PER_HOUR count
  | MAX_CONNECTIONS_PER_HOUR count

The GRANT statement enables system administrators to create MySQL user
accounts and to grant rights to accounts. To use GRANT, you must have
the GRANT OPTION privilege, and you must have the privileges that you
are granting. GRANT is implemented in MySQL 3.22.11 or later. For
earlier MySQL versions, it does nothing. The REVOKE statement is
related and enables administrators to remove account privileges. See
[HELP REVOKE].

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

Important: Some releases of MySQL introduce changes to the structure of
the grant tables to add new privileges or features. Whenever you update
to a new version of MySQL, you should update your grant tables to make
sure that they have the current structure so that you can take
advantage of any new capabilities. See
http://dev.mysql.com/doc/refman/4.1/en/mysql-fix-privilege-tables.html.

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.)

Privileges can be granted at several levels:

o 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.

o Database level

  Database privileges apply to all tables 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.

o 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.

o 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.
