メインコンテンツまでスキップ
バージョン: 2.1

CURRENT_USER

説明

現在のユーザー名とそのIPルールホワイトリストを取得します。

構文

CURRENT_USER()

戻り値

現在のユーザー名とそのIPホワイトリストを返します。

形式:<user_name>@<ip_white_list>

  • rootユーザー、IP制限なし
select current_user();
+----------------+
| current_user() |
+----------------+
| 'root'@'%' |
+----------------+
  • dorisユーザー、IPホワイトリストは192.168.*
select current_user();
+---------------------+
| current_user() |
+---------------------+
| 'doris'@'192.168.%' |
+---------------------+
このページでは