MySQL
  Home arrow MySQL arrow Page 6 - Access Granted
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Access Granted
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2001-04-24

    Table of Contents:
  • Access Granted
  • Meet Joe User
  • Beeping Turkeys
  • Born Privileged
  • The Perfect Host
  • Cream Of The Crop
  • The Mechanics

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Access Granted - Cream Of The Crop


    (Page 6 of 7 )

    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


     

       

    MYSQL ARTICLES

    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT