Evaluating Privileges


Four sets of privileges are granted with the GRANT statement:

  • Global privileges apply across all databases. These are specified with *.* in a GRANT statement. For example:

     
     grant all on *.* to fred; 
  • Database privileges apply to one particular database. These are granted with database .* in a GRANT statement:

     
     grant all on employee.* to fred; 
  • Table privileges apply to a single table. These are granted by naming a specific table in the GRANT statement:

     
     grant select on department to fred; 
  • Column privileges apply to a single column. These are specified in the GRANT clause of the GRANT statement. For example:

     
     grant select (employeeID) on employee to fred; 

When trying to work out whether a user has a privilege to do a particular task, MySQL will look at the combination of that user 's global privileges plus his database privileges plus his table privileges plus his column privileges OR ed together.



MySQL Tutorial
MySQL Tutorial
ISBN: 0672325845
EAN: 2147483647
Year: 2003
Pages: 261

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net