Home arrow MySQL arrow The MySQL Grant Tables

The MySQL Grant Tables

One of the most powerful aspects of the MySQL server is the amazing amount of control the administrator has over each user's intended behavior. This control can restrict user privileges over a general part of the server, such as limited access to an entire database, but can also be as specific as limiting privileges for a specific table or even column.

TABLE OF CONTENTS:
  1. The MySQL Grant Tables
  2. Access Control
  3. Tables_priv and columns_priv
  4. References
By: W.J. Gilmore
Rating: starstarstarstarstar / 21
March 01, 1999

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
One of the most powerful aspects of the MySQL server (http://www.mysql.com) is the amazing amount of control the administrator has over each user's intended behavior. This control can restrict user privileges over a general part of the server, such as limited access to an entire database, but can also be as specific as limiting privileges for a specific table or even column. This article will serve to explain the process in which the MySQL server grants/revokes these user privileges, highlighting in particular the newest additions to the MySQL privilege system, the tables_priv and columns_priv tables. Please keep in mind that the GRANT/REVOKE commands detailed later in this article are only relevant to MySQL version 3.22.11 and up. These commands are irrelevant to any previous version.

The MySQL privilege system is controlled within the MySQL database. There are currently 5 tables that provide this control; the user, db, host, tables_priv and columns_priv tables. These tables all vary slightly in purpose, yet all serve the same function which is to verify that the user is doing what the user is allowed to do. Each table can be broken down into two categories of fields: scope fields and privilege fields. The scope fields identify a host, user or database. The privilege fields determine which actions can be performed in reference to that host, user or database. Let's take a brief look at each table's function:

  • user - Determines whether or not the connecting user is allowed to connect to the server. Assuming the connection is allowable, the privilege fields contain the user's global privileges.
  • db - Determines which users can access which databases from which hosts. The privilege contained within the db table apply to the database identified within this table.
  • host - The host table is used when you want to extend an entry within the db table's range. For example, if a certain db is to be accessed by more than one host, then the superuser would leave the host column empty within the db table and fill the host table with all of the necessary hostnames.
  • tables_priv - In principle works just like the db table, except that it is used for tables instead of databases. This table also contains one other field category (Other) in which a timestamp and grantor column is stored.The tables_priv table will be explained in further detail later in this article.
  • columns_priv - Works just like the db and tables_priv tables, except that it provides access privileges for certain columns of certain tables. This table also contains one other field category (Other) in which a timestamp column is stored. The columns_priv table will be explained in further detail later in this article.

Let's move on to an explantion of MySQL's user-authorization procedure.

Part 1: The MySQL Access Control Process.
How do the MySQL Grant tables work anyway?

Part 2: The tables_priv and columns_priv grant tables.
An explanation and several examples relating to MySQL's tables_priv table.

Part 3: References
An explanation and several examples relating to MySQL's columns_priv grant table.


 
 
>>> More MySQL Articles          >>> More By W.J. Gilmore
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

MYSQL ARTICLES

- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: