SHOW-PROCESSLIST
Name
SHOW PROCESSLIST
Description
Display the running threads of the user. It should be noted that except the root user who can see all running threads, other users can only see their own running threads, and cannot see the running threads of other users.
grammar:
SHOW [FULL] PROCESSLIST
illustrate:
- 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.
- Time: Indicates the time the thread is in the current state.
- State: The state of the thread, corresponding to Command.
- 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.
Common Command types are as follows:
- Query: The thread is executing a statement
- Sleep: is waiting for a client to send it an execute statement
- Quit: the thread is exiting
- Kill : The kill statement is being executed to kill the specified thread
Other types can refer to MySQL official website for explanation
Example
View the threads running by the current user
SHOW PROCESSLIST
Keywords
SHOW, PROCESSLIST