Documentation Home
MySQL 8.3 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.8Mb
PDF (A4) - 40.9Mb
Man Pages (TGZ) - 294.0Kb
Man Pages (Zip) - 409.0Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb
Excerpts from this Manual

MySQL 8.3 Reference Manual  /  ...  /  The ps_thread_account() Function

30.4.5.14 ps_thread_account() 函数

给定性能模式线程 ID,返回与线程关联的 用户名@主机名 帐户。

参数
  • in_thread_id BIGINT UNSIGNED:要返回帐户的线程 ID。该值应与某个性能模式 threads 表行的 THREAD_ID 列匹配。

返回值

一个 TEXT 值。

示例
mysql> SELECT sys.ps_thread_account(sys.ps_thread_id(CONNECTION_ID()));
+----------------------------------------------------------+
| sys.ps_thread_account(sys.ps_thread_id(CONNECTION_ID())) |
+----------------------------------------------------------+
| root@localhost                                           |
+----------------------------------------------------------+