You can execute the SHOW PROCESSLIST
statement to view the running processes.
Note You can also execute the
INFORMATION_SCHEMA PROCESSLIST
statement to view the running processes.
Syntax
SHOW [FULL] PROCESSLIST
Response parameters
The following response parameters are returned after you execute the SHOW FULL PROCESSLIST
or SHOW PROCESSLIST
statement:
- Id: the ID of the process.
- ProcessId: the unique ID of the task. This parameter is required when you execute
the
KILL PROCESS
statement. - User: the current account.
- Host: the hostname of the client that sends the SHOW PROCESSLIST statement. The hostname consists of the IP address and port number of the client.
- DB: the database to which the process is connected.
- Command: the statement that is executed in the current connection. The statement types include sleep, query, and connect.
- Time: the time when the statement is executed. Unit: seconds.
- State: the execution status of the SQL statement in the current connection.
- Info: the SQL statement.
Note If you do not specify the
FULL
keyword, you can view only the first 100 characters of the Info field in each record.
Permissions
- You can execute the
SHOW PROCESSLIST
statement to view the processes running under your account. - A privileged account of a cluster can grant the PROCESS permission to a standard account
by using the GRANT statement. The standard account can then view the running processes
of all accounts in the cluster.
GRANT process on *.* to account_name;