Query the locked process information of MySQL in Linux.
1. Problem Description
When using the database, tables may be locked, causing timeout when other processes access the same table. Specifically, use the following command in MySQL:
SHOW PROCESSLIST
The result is
The Status column indicates the query Status of the statement. If the value is Locked, the query is Locked by other queries. HZ success? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> vc3Sx7cq + t6Kz9rLp0a/keys/2 reis/keys + keys/keys + dTavfizzLXEz + keys/PC9wPgo8aDE + Mi4gveK + 9re9t6g8L2gxPgo8aDI + YS4guPm + 3VRDULbLv9q6xaOssum/placement = "brush: SQL; "> lsof-Pnl + M-i4 | grep 38292
Method 2: netstat
netstat -anp | grep 38292
Run the preceding statement on the host 192.168.1.152, as shown in. The process PID corresponding to port 38292 obtained by the two methods is 11882.
B. view the process information based on the PID and run the following command on host 192.168.1.152 to view the process information.
ps aux | grep 11882
As shown in, you can view basic information such as the commands started by the process.
Based on the above information, you can troubleshoot the MySQL query lock table and provide the required information for further debugging.