On Tue, 23 Dec 2003 18:20:53 -0600
Paul DuBois <paul@stripped> wrote:
> >
> >I confirm:
> >SHOW GRANTS FOR CURRENT_USER();
> >does not work,
> >while that query is exaclty what you expect to do reading mysql manual.
>
> I agree, one might easily come to that conclusion based on the wording.
>
> The manual was imprecise/wrong. I've changed it to point out that
> you must first select the value of CURRENT_USER(), then use the value
> it returns in the SHOW GRANTS statement.
good idea,
thank you.
>
> >
> >
> >On Tue, 23 Dec 2003 12:47:11 +0200
> >Egor Egorov <egor.egorov@stripped> wrote:
> >
> >> Plinio Conti <plinioNOcontiSPAM@stripped> wrote:
> >> >
> > > > The manual page at http://www.mysql.com/doc/en/SHOW_GRANTS.html
> >> > says:
> >> >
> >> > "To list grants for the current session one may use
> >>CURRENT_USER() function"
> >> >
> >> > But if I run
> >> > "SELECT SHOW GRANTS FOR CURRENT_USER();
> >> >
> >> > I get syntax error (Error 1064).
> >> >
> >> > While if I run directly
> >> > "SELECT SHOW GRANTS FOR foouser@hostname;"
> >> >
> >> > It works. Did you guess why?
> >>
> >> Look at the example of usage SHOW GRANTS in the manual:
> >>
> >> mysql> SHOW GRANTS FOR root@localhost;
> >>
> >> There is no SELECT word in the query.
> >>
> >> >
> >> > On Mon, 22 Dec 2003 15:37:43 +0200
> >> > Egor Egorov <egor.egorov@stripped> wrote:
> >> >
> >> >> Plinio Conti <plinioconti@stripped> wrote:
> >> >> >
> >> >> > Is there a way to query the privileges of current user if he
>
> >>hasn't the rights to read the mysql system tables (user, db, hosts,
> >>etc..)
> >> >> >
> >> >> > I mean, I CAN'T give a standard user the chance of read
> >>"system tables"!
> >> >> > But my client app wants to know if the current user has (for
>
> >>example) the rights to write on table xxx, because if not, I don't
> >>want to let him try and fail, I want to disable the updates in
> >>advance.
> >> >> >
> >> >>
> >> >> Take a look at SHOW GRANTS command:
> > > >> http://www.mysql.com/doc/en/SHOW_GRANTS.html
>
>
> --
> Paul DuBois, Senior Technical Writer
> Madison, Wisconsin, USA
> MySQL AB, www.mysql.com
>
> Are you MySQL certified? http://www.mysql.com/certification/
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1