Check the current user in MySQL command line

database, mysql, mysql-command-line-client, mysqlcommand, sql

Solution

There is a MYSQL function `user()`. To get the user:

SELECT USER();

This will return something like username@hostname.

Problem

Here is my question about MySQL. After I log in to MySQL using: ``` mysql -u myname -p ... mysql> ``` I wanted to know what the username I used to logon. Is there a way to check this? like "whoami" in unix? Thanks.

Original source

Related problems