SHOW-PROCESSLIST
Name
SHOW PROCESSLIST
Description
Display the running threads of the user. It should be noted that only the root user can see all running threads, and other users can only see the running threads of their own.
Syntax:
SHOW [FULL] PROCESSLIST
Note:
- Id: It is the unique identifier of this thread. When we find that there is a problem with this thread, we can use the kill command to add this Id value to kill this thread. Earlier we said that the information displayed by show processlist comes from the information_schema.processlist table, so this Id is the primary key of this table.
- User: refers to the user who started this thread.
- Host: Records the IP and port number of the client sending the request. Through this information, when troubleshooting the problem, we can locate which client and which process sent the request.
- Cluster: Cluster name
- DB: which database the currently executed command is on. If no database is specified, the value is NULL .
- Command: refers to the command that the thread is executing at the moment. This is very complicated, and is explained separately below
- Time: Indicates the time the thread is in the current state.
- State: The state of the thread, corresponding to Command, explained separately below.
- Info: Generally recorded is the statement executed by the thread. By default, only the first 100 characters are displayed, that is, the statement you see may be truncated. To see all the information, you need to use show full processlist.
Example
-
View the threads running by the current user
SHOW PROCESSLIST
Keywords
SHOW, PROCESSLIST