Query the locked process information of MySQL in Linux.

Source: Internet
Author: User

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.

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.