Skip to main content

CURRENT_USER

Descriptionโ€‹

Get the current username and its IP rule whitelist.

Syntaxโ€‹

CURRENT_USER()

Return Valueโ€‹

Returns the current username and its IP whitelist.

Format:<user_name>@<ip_white_list>

Examplesโ€‹

  • root user, no IP restrictions
select current_user();
+----------------+
| current_user() |
+----------------+
| 'root'@'%' |
+----------------+
  • doris user, IP whitelist is 192.168.*
select current_user();
+---------------------+
| current_user() |
+---------------------+
| 'doris'@'192.168.%' |
+---------------------+

Enter to send ยท Shift+Enter for a new line