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:
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.
blog comments powered by Disqus |