title: How to kill locking query from "show processlist" in mysql
body: <p>I a have task to monitor queries on server and kill the queries which are locking other queries which I am doing from PHP code. 
  I want to know if this is possible and how this can be done.</p>
  
  <p>I have  searched existing questions on this topic but there was not any matching situation.</p>
  
  <p>I am using <code>show processlist</code> to get list of queries.</p>
  
  <p>I have checked the mysql site and found that "state" can be,</p>
  
  <blockquote>
    <p>Locked - The query is locked by another query.</p>
  </blockquote>
  
  <p>But how to get process id of the query which has locked this query, so later I can kill this query by this id.</p>