title: How to troubleshoot MySQL `ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction`
body: <p>I seem to not be able extract any helpful information from MySQL to aid my debugging for this error: <code>ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction</code>. Can you help me find some?</p>
  
  <p>Reproduction:</p>
  
  <p>One process does something like this:</p>
  
  <pre><code>start transaction;
  update cfgNodes set name="foobar" where ID=29;
  </code></pre>
  
  <p>and just sits there (not committing, not rolling back). This is clearly the culprit - the process that is hogging the lock because of a long-running transaction - the offender I'm trying to find.</p>
  
  <p>Another process tries:</p>
  
  <pre><code>-- The next line just prevents you from having to wait 50 seconds
  set innodb_lock_wait_timeout=1;
  
  update cfgNodes set name="foobar" where ID=29;
  </code></pre>
  
  <p>This second process gets <code>ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction</code> (after <code>innodb_lock_wait_timeout</code>, default 50secs)</p>
  
  <p>How do I find any information about the culprit?</p>