mysql: whoami?

Solution 1:

You can use the CURRENT_USER and USER functions as follows:

SELECT CURRENT_USER();

SELECT USER();

CURRENT_USER shows who you are authenticated as, while USER shows who you tried to authenticate as.

See the MySQL manual for more information.

Solution 2:

If you are using mysql command line utility then try \s command:

mysql> \s
--------------
mysql  Ver 14.12 Distrib 5.0.67, for suse-linux-gnu (i686) using readline 5.2

Connection id:          519
Current database:
Current user:           admin@localhost
.........
Server version:         5.0.67 SUSE MySQL RPM
.........