MySQL Show Processlist Description

Source: Internet
Author: User
Tags diff

Show Processlist and show full processlist

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

Mysql> Show processlist;+----+------+--------------------+------+---------+-------+-------+------------------ +| Id | User | Host | db | Command | Time | State | Info |+----+------+--------------------+------+---------+-------+-------+------------------+|1| Root | localhost |NULL| Sleep | A| |NULL||2| Root |192.168.100.1:7437| Test | Sleep |8035| |NULL||3| Root |192.168.100.1:7438|NULL| Sleep |24348| |NULL||5| Root |192.168.100.1:7443|NULL| Sleep |24317| |NULL||7| Root |192.168.100.1:7450| Test | Sleep |24272| |NULL||9| Root |192.168.100.1:5152| Test | Query |0| init | Show Processlist |+----+------+--------------------+------+---------+-------+-------+------------------+6RowsinchSetmysql> Show Full processlist;+----+------+--------------------+------+---------+-------+-------+----------- ------------+| Id | User | Host | db | Command | Time | State | Info |+----+------+--------------------+------+---------+-------+-------+-----------------------+|1| Root | localhost |NULL| Sleep | +| |NULL||2| Root |192.168.100.1:7437| Test | Sleep |8042| |NULL||3| Root |192.168.100.1:7438|NULL| Sleep |24355| |NULL||5| Root |192.168.100.1:7443|NULL| Sleep |24324| |NULL||7| Root |192.168.100.1:7450| Test | Sleep |24279| |NULL||9| Root |192.168.100.1:5152| Test | Query |0| init | Show full processlist |+----+------+--------------------+------+---------+-------+-------+----------------------- +6RowsinchSet

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:

back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.htmlBack to Site Architecture series article outline: http://www.cnblogs.com/f-ck-need-u/p/7576137.htmlback to Database series article outline: http://www.cnblogs.com/f-ck-need-u/p/7586194.htmlReprint Please specify Source: http://www.cnblogs.com/f-ck-need-u/p/7742153.htmlNote: If you think this article is not bad please click on the lower right corner of the recommendation, your support can inspire the author more enthusiasm for writing, thank you very much!

MySQL Show Processlist Description

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.