CURRENT_USER()
CURRENT_USER()
This function returns the username and the host that were given by the user for the current MySQL connection. There are no arguments for the function. It may not always return the same results as USER(). Here is an example:
SELECT CURRENT_USER( ), USER( ); +-----------------+------------------+ | CURRENT_USER( ) | USER( ) | +-----------------+------------------+ | ''@localhost | russel@localhost | +-----------------+------------------+
In this example, the user logged in to the mysql client with the username russel (missing one “l” in the name), but because there isn’t an account for that user, the client logged in with the anonymous (i.e., '') account.