List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:October 3 1999 10:53pm
Subject:Re: Table_priv, Column_priv
View as plain text  
On Sun, 1999-10-03 20:22:14 +0000, eddiev@stripped wrote:
> THe manual has a very good chapter 
> (http://www.mysql.com/Manual_chapter/manual_Privilege_system.html#Privil
> ege_system) about the priviledge system.
> 
> Unfortunately the information was somewhat confusing for me ( as for 
> table_priv and column_priv).

What has been confusing to you?  What information do you think is
missing?  (The MySQL team only can make things better, if they get to
know where the weak points are ...)

> Can you send me some examples of it's use ?
> If I need to create two users, one with access to the whole database 
> and another to specific tables how should I fill my mysql.db
> (host,table_priv) tables ?
> 
> host = foo.com.br
> user1 = joe - access to read,write all tables, foo database
> user2 = jr - access to read bar1, bar2 tables from foo database
> database = foo
> tables = bar1, bar2, bar3

In contrast to earlier versions of MySQL, where you had to change the
privilege tables directly, starting with version 3.22.11 there is the
GRANT command, that does all changes to these tables automatically!

(There still is at least one case where manual changes are necessary,
 if you want wildcards in the db fields of mysql.db)

So to solution for the task given above is:

 GRANT SELECT, INSERT, UPDATE, DELETE 
    ON foo.*
    TO joe@stripped;
 GRANT SELECT
    ON foo.bar1
    TO jr@stripped;
 GRANT SELECT
    ON foo.bar2
    TO jr@stripped;

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=5244 5EF3 B0B1 3826  E4EC 8058 7B31 3AD7
Thread
Table_priv, Column_priveddiev4 Oct
  • Re: Table_priv, Column_privMartin Ramsch4 Oct