The output of the Processlist command shows which threads are running, not only the current number of connections, but also the current connection status to help identify problematic query statements.
If it is the root account, you can see the current connection for all users. If it is a different normal account, you can only see the connections that you occupy. Showprocesslist can only list the current 100 articles. If you want to list them all, you can use the show full Processlist command
The meaning of each column:
①.id column, when a user logs on to MySQL, the system assigns "connection_id", which can be viewed using the function connection_id ()
The ②.user column that displays the current user. If it is not root, this command displays only the SQL statements for the user's permission range
The ③.host column, which shows which IP port this statement was sent from, can be used to track the user who has the problem statement
The ④.db column that shows which database the process is currently connected to
The ⑤.command column, which displays the execution commands for the current connection, typically sleeps (sleep), queries (query), connection (connect), etc.
⑥.time column that shows the duration of this state, in seconds
The ⑦.state column, which displays the status of the SQL statement using the current connection, is an important column. State describes one of the states in a statement execution. An SQL statement, for example, may need to be copying to TMP table, sorting result, sending data, etc.
The ⑧.info column, which displays this SQL statement, is an important basis for judging the problem statement.
In a master-slave replication environment, show processlist or show full processlist is useful for judging states, such as the following State column:
MySQL show processlist and show full processlist difference