Skip to main content

SHOW PROCESSLIST

Description​

Displays the thread that the user is running

Syntax​

SHOW [FULL] PROCESSLIST

Optional Parameters​

1. FULL

Indicates whether to view the connection information of other users

Return Value​

columnInstructions
CurrentConnectedWhether the connection is current
IdThe unique identification of this thread
UserThe user who started this thread
HostThe IP address and port number of the client sending the request are recorded
LoginTimeTime to establish a connection
CatalogIn which data directory is the command currently executed
DbOn which database is the command being executed? If no database is specified, the value is NULL
CommandThe command that the thread is executing at this moment
TimeTime when the previous command is submitted to the current status, in seconds
StateState of thread
QueryIdID of the current query statement
InfoGenerally, the statement executed by the thread is recorded, and only the first 100 characters are displayed by default

Common Command types are as follows:

columnInstructions
QueryThe thread is executing a statement
SleepWaiting for the client to send it an execution statement
QuitThe thread is exiting
KillExecuting the kill statement

Access Control Requirements​

The user who executes this SQL command must have at least the following permissions:

PrivilegeObjectNotes
ADMIN_PRIVDATABASEIf you want to view the connection information of other users, you need the ADMIN permission

Examples​

SHOW PROCESSLIST
+------------------+------+------+-----------------+---------------------+----------+------+---------+------+-------+-----------------------------------+-----------------------+
| CurrentConnected | Id | User | Host | LoginTime | Catalog | Db | Command | Time | State | QueryId | Info |
+------------------+------+------+-----------------+---------------------+----------+------+---------+------+-------+-----------------------------------+-----------------------+
| Yes | 0 | root | 127.0.0.1:34650 | 2025-01-21 12:01:02 | internal | test | Query | 0 | OK | c84e397193a54fe7-bbe9bc219318b75e | select 1 |
| | 1 | root | 127.0.0.1:34776 | 2025-01-21 12:01:07 | internal | | Sleep | 29 | EOF | 886ffe2894314f50-8dd73a6ca06699e4 | show full processlist |
+------------------+------+------+-----------------+---------------------+----------+------+---------+------+-------+-----------------------------------+-----------------------+