Saturday 28 September 2019

login - how do I see which user I am logged in as in MySQL?


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?



Answer



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


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...