----- Original Message ----- 
From: "Mark C. Stafford" <[EMAIL PROTECTED]>
To: "MySQL List" <[EMAIL PROTECTED]>
Sent: Monday, September 06, 2004 11:11 PM
Subject: Re: Without grant option?


> On Mon, 6 Sep 2004 19:53:17 -0400, Rhino <[EMAIL PROTECTED]> wrote:
> > I just assumed it might work the
> > same in MySQL.
>
> That's where I started as well, Rhino. Here is a simplified version
> what I did, line for line:
>
> mysql> /* never heard of him, right? */
>     -> SHOW GRANTS FOR 'jdoe'@'192.168.%';
> ERROR 1141: There is no such grant defined for user 'jdoe' on host
'192.168.%'
>
> mysql>
> mysql> /* WITH GRANT OPTION */
>     -> GRANT SELECT, INSERT, UPDATE
>     -> ON test.*
>     -> TO 'jdoe'@'192.168.%'
>     -> IDENTIFIED BY 'uhoh'
>     -> WITH GRANT OPTION;
> Query OK, 0 rows affected (0.01 sec)
>
> mysql>
> mysql> /* not spreading the GRANT OPTION, right? */
>     -> GRANT DELETE
>     -> ON test.*
>     -> TO 'jdoe'@'192.168.%';
> Query OK, 0 rows affected (0.00 sec)
>
> mysql>
> mysql> /* applying the changes */
>     -> FLUSH PRIVILEGES;
> Query OK, 0 rows affected (0.01 sec)
>
> mysql>
> mysql> /* WTF?, over */
>     -> SHOW GRANTS FOR 'jdoe'@'192.168.%';
>
+---------------------------------------------------------------------------
---------------+
> | Grants for [EMAIL PROTECTED]
>                     |
>
+---------------------------------------------------------------------------
---------------+
> | GRANT USAGE ON *.* TO 'jdoe'@'192.168.%' IDENTIFIED BY PASSWORD
> '14592d223aea00a7'       |
> | GRANT SELECT, INSERT, UPDATE, DELETE ON `test`.* TO
> 'jdoe'@'192.168.%' WITH GRANT OPTION |
>
+---------------------------------------------------------------------------
---------------+
> 2 rows in set (0.00 sec)
>
I can't make out from the output whether the grants worked or not. The real
test though is whether the GRANTs actually *work*. If you try doing a delete
on the table and it works but if you can't grant the DELETE privilege to
someone else, I'd say your GRANTs are working correctly regardless of what
the MySQL privilege tables show. (Of course, that assumes that the SELECT,
INSERT, and UPDATE also work and *can* be granted to others.)

If you aren't getting the desired results, you might be better to ignore me;
I may simply be wrong. [Perhaps the GRANT command works differently in MySQL
than it does in DB2.] In that case, you may need to post your question
again; I'll stay out of the discussion then and let people with more
experience help you.

Rhino



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to