title: Lock wait timeout exceeded; try restarting transaction' error when trying to update mysql table using python
body: <p>I am using python to call a table in mysql and executing queries. I am getting an error:</p>
  
  <pre><code>_mysql_exceptions.OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction')
  </code></pre>
  
  <p>tbl_1 is a table in which I have to update isprocessed column.</p>
  
  <pre><code>cursor.execute('UPDATE tbl_1 SET isprocessed=1 where name='+body)
  cursor.close()
  cursor1 = db.cursor()
  cursor1.execute('SELECT name,height,age,weight from tbl_1 where name='+body)
  </code></pre>
  
  <p>Body is taking value in a message queue.If I run the code without UPDATE query its running fine. I thought <code>cursor.close</code> will solve the problem but it didn't. I also restarted mysql. I have gone through similar questions but none of them solve my issue.Any help appreciated.</p>
  
  <p>I have set <code>innodb_lock_wait_timeout</code> from 50 to 63000  </p>