CURRENT_USER, CURRENT_USER()
SELECT USER();
'davida@localhost'
SELECT * FROM mysql.user;
ERROR 1044: Access denied for user ''@'localhost' to
database 'mysql'
SELECT CURRENT_USER();
'@localhost'
Returns the user name and host name combination for the MySQL account that the server used to authenticate the current client. This account determines your access privileges. The return value is a string in the utf8mb3 character set.
SELECT USER();
'davida@localhost'
SELECT * FROM mysql.user;
ERROR 1044: Access denied for user ''@'localhost' to
database 'mysql'
SELECT CURRENT_USER();
'@localhost'
The value of CURRENT_USER() can differ from the value of USER().
CREATE TABLE t (c VARCHAR(288) DEFAULT (CURRENT_USER()));