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.