CURRENT_USER, CURRENT_USER()
Returns the user name and host name combination for the MariaDB account that the server used to authenticate the current client. This account determines your access privileges. The return value is a string in the utf8 character set.
The value of CURRENT_USER()
can differ from the value of USER(). CURRENT_ROLE() returns the current active role.
Statements using the CURRENT_USER
function are not safe for statement-based replication.
shell> mysql --user="anonymous"
SELECT USER(),CURRENT_USER();
+---------------------+----------------+
| USER() | CURRENT_USER() |
+---------------------+----------------+
| anonymous@localhost | @localhost |
+---------------------+----------------+
When calling CURRENT_USER()
in a stored procedure, it returns the owner of the stored procedure, as defined with DEFINER
.
This page is licensed: GPLv2, originally from fill_help_tables.sql