Plinio Conti <[EMAIL PROTECTED]> wrote:
> Sorry,
> I was not using any SELCT in my queries,
> it's just an error typing the email
> 
> I confirm:
> SHOW GRANTS FOR CURRENT_USER();
> does not work,
> while that query is exaclty what you expect to do reading mysql manual.

It means that you can use CURRENT_USER() function to know username and hostname that 
the current session was authenticated as. And then you can use this info in the SHOW 
GRANTS statement. For example:

mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| [EMAIL PROTECTED] |
+----------------+
1 row in set (0.00 sec)

mysql> SHOW GRANTS FOR [EMAIL PROTECTED];
+------------------------------------------------------------------------------------+
| Grants for [EMAIL PROTECTED]                                                         
 |
+------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'egor'@'localhost' IDENTIFIED BY PASSWORD '332ab33958e81d12' |
| GRANT ALL PRIVILEGES ON `egor`.* TO 'egor'@'localhost'                             |
+------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)


> On Tue, 23 Dec 2003 12:47:11 +0200
> Egor Egorov <[EMAIL PROTECTED]> wrote:
> 
>> Plinio Conti <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED];"
>> > 
>> > It works. Did you guess why?
>> 
>> Look at the example of usage SHOW GRANTS in the manual:
>> 
>>       mysql> SHOW GRANTS FOR [EMAIL PROTECTED];
>> 
>> There is no SELECT word in the query.



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




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

Reply via email to