I have multiple text console session open and log in as different users into different consoles. I forget after while which consoles belong to which user, it would be nice to not have to quit and log back in.

How do I see which user I am logged in as?

Is there a way to change which user I logged in as with out logging out?

link|improve this question

feedback

3 Answers

up vote 1 down vote accepted

Actually, you need to use two functions

SELECT USER(),CURRENT_USER();

USER() reports how you attempted to authenticate in MySQL

CURRENT_USER() reports how you were allowed to authenticate in MySQL

Sometimes, they are different

link|improve this answer
feedback

Does

select user();

work?

I pinched it from the 3rd google result for 'mysql whoami':

link|improve this answer
feedback

I found this user() function

select user(); Will show you which user is logged in.

link|improve this answer
Does that link still work for you? I decided to link to google's cache because of the mysql -> oracle breakage. – PriceChild Apr 5 '11 at 8:00
It does work, it has an other interesting function as well select database(); will show you your currently selected database. – nelaar Apr 5 '11 at 8:07
That's really annoying, I wonder why it doesn't work for me. Thanks. – PriceChild Apr 5 '11 at 8:08
@pricechild dev.mysql.com/doc/refman/5.5/en/… – nelaar Apr 5 '11 at 8:21
Nope, sends me to search.oracle.com/search/… – PriceChild Apr 5 '11 at 8:30
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.