Home arrow MySQL arrow Page 6 - Access Granted

Cream Of The Crop - MySQL

mySQL comes with a pretty powerful security system, the grant tables, which allows database administrators to precisely control access to databases, tables and even specific rows and columns. In this article, find out how the five grant tables combine to offer power users a tremedous amounts of flexibility and control over database access and operations.

TABLE OF CONTENTS:
  1. Access Granted
  2. Meet Joe User
  3. Beeping Turkeys
  4. Born Privileged
  5. The Perfect Host
  6. Cream Of The Crop
  7. The Mechanics
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 9
April 24, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
In addition to the three tables already discussed, newer versions of mySQL also come with two additional tables, the "tables_priv" and "columns_priv" tables. These allow a database administrator to restrict access to specific tables in a database, and specific columns of a specific table, respectively.

Here's what these two tables look like:

tables_priv: +-------------+---------------------------+ | Field | Type | +-------------+---------------------------+ | Host | char(60) | | Db | char(60) | | User | char(16) | | Table_name | char(60) | | Grantor | char(77) | | Timestamp | timestamp(14) | | Table_priv | set('Select','Insert'...) | | Column_priv | set('Select','Insert'...) | +-------------+---------------------------+ columns_priv: +-------------+----------------------------------------------+ | Field | Type | +-------------+----------------------------------------------+ | Host | char(60) | | Db | char(60) | | User | char(16) | | Table_name | char(60) | | Column_name | char(60) | | Timestamp | timestamp(14) | | Column_priv | set('Select','Insert','Update','References') | +-------------+----------------------------------------------+

The following example would restrict user to performing SELECT operations on table "cream" *only* - any attempt to run a SELECT query on another table within the same database would result in an error.

+-----------------+-------+------+------------+---------------+-------------+ | Host | Db | User | Table_name | Table_priv | Column_priv | +-----------------+-------+------+------------+---------------+-------------+ |lost.soul.com | db563 | john | cream | Select | | +-----------------+-------+------+------------+---------------+-------------+


 
 
>>> More MySQL Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
   

MYSQL ARTICLES

- Xeround Releases Free Version of MySQL Cloud...
- Oracle Announces New MySQL Specialization
- Constant Contact Chooses SkySQL for MySQL Su...
- Revoke Statement in MySQL
- The Grant Statement in MySQL
- SuccessBricks Announces ClearDB Availability...
- Building a PHP ORM: Deploying a Blog
- TROSYS Launches Free MySQL Manager and Admin...
- Building an ORM in PHP: Domain Modeling
- Building an ORM in PHP
- MySQL Leads Open Source Market, Gets Cluster...
- Oracle Announces Milestone Release for MySQL
- How to Stop SQL Injection Attacks
- New Defragmentation Solution for SQL Server
- Comparison of MyISAM and InnoDB MySQL Databa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: