processlist command to view Mysql thread _mysql

Source: Internet
Author: User

1. Enter the Mysqladmin processlist into the Mysql/bin catalogue;
2. Start MySQL, enter show processlist (Close a thread kill ID;);
If you have SUPER permissions, you can see all of the threads, otherwise you can only see the thread that you originated (this is the current corresponding MySQL account running thread).
The data forms are as follows (only three are intercepted):
Mysql> show Processlist;
+-----+-------------+--------------------+-------+---------+-------+----------------------------------+-------- --
| Id | User | Host | db | Command | time| State | Info
+-----+-------------+--------------------+-------+---------+-------+----------------------------------+-------- --
|207|root |192.168.0.20:51718 |mytest | Sleep | 5 | | Null
|208|root |192.168.0.20:51719 |mytest | Sleep | 5 | | Null
|220|root |192.168.0.20:51731 |mytest | Query | 84 | Locked |
Select Bookname,culture,value,type from book where id=001
First of all, the meaning and use of the columns, the first column, ID, needless to say, a logo, you want to kill a statement when it is useful. The user column, which displays a single user, and if not root, this command displays only the SQL statements within your purview. The host column, which indicates which IP port the statement is issued from. Oh, can be used to track the user of the problem statement. DB column that shows which database the process is currently connected to. Command column, which displays commands for the execution of the current connection, generally hibernation (sleep), queries (query), connection (connect). Time column, which is the duration of this state, in seconds. State column, which shows the status of the SQL statement using the current connection, a very important column, followed by a description of all States, note that State is only one of the States in the execution of the statement, an SQL statement, a query as an example, may need to go through copying to TMP table, Sorting result,sending data can be completed, info column, display this SQL statement, because the length is limited, so long SQL statement is not complete, but an important basis for judging the problem statement.

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.