MySQL 9.0 发行说明
给定一个 Performance Schema 线程 ID,返回与该线程关联的
帐户。user_name
@host_name
in_thread_id BIGINT UNSIGNED
: 要返回其帐户的线程 ID。该值应与某些 Performance Schemathreads
表行中的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 |
+----------------------------------------------------------+