THE WORLD'S LARGEST WEB DEVELOPER SITE

MySQL CURRENT_USER() Function

❮ MySQL Functions

Example

Return the user name and host name for the MySQL account:

SELECT CURRENT_USER();
Try it Yourself »

Definition and Usage

The CURRENT_USER() function returns the user name and host name for the MySQL account used by the server to authenticate the current client.

Note: The CURRENT_USER() function uses the UTF8 character set.

Tip: See also the USER() function.

Syntax

CURRENT_USER()

Technical Details

Works in: MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0.6

❮ MySQL Functions