MySQL show processlist and show full processlist difference

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.