Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 43.2Mb
PDF (A4) - 43.3Mb
Man Pages (TGZ) - 296.3Kb
Man Pages (Zip) - 401.6Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
Excerpts from this Manual

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

30.4.5.14 The ps_thread_account() Function

Given a Performance Schema thread ID, returns the user_name@host_name account associated with the thread.

Parameters
  • in_thread_id BIGINT UNSIGNED: The thread ID for which to return the account. The value should match the THREAD_ID column from some Performance Schema threads table row.

Return Value

A TEXT value.

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