MySQL 8.4 发行说明
给定性能模式线程 ID,返回与该线程关联的
帐户。user_name
@host_name
in_thread_id BIGINT UNSIGNED
:要返回其帐户的线程 ID。该值应与某个性能模式threads
表行的THREAD_ID
列匹配。
mysql> SELECT sys.ps_thread_account(sys.ps_thread_id(CONNECTION_ID()));
+----------------------------------------------------------+
| sys.ps_thread_account(sys.ps_thread_id(CONNECTION_ID())) |
+----------------------------------------------------------+
| root@localhost |
+----------------------------------------------------------+