title: MySQLdb error when using cursor.execute()
body: <p>I am using python and specifically MySQLdb to fill a database, although a code that was working until recently is throwing up an error after moving servers at work:</p>
  
  <p>The code is:</p>
  
  <pre><code>cursor.execute("""SELECT Entry, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P FROM evaluation""")
  
  result = cursor.fetchall()
  
  for record in result:
      codeno=int(str(record[15]))
      status, progress, reprocessing = RepStatus_new.get_status(code=codeno, proj_tag=str(record[16]),cache_dir="cache", prod_type="g1")
      cursor.execute("""UPDATE evaluation SET M=%s WHERE A LIKE %s""",(progress, int(str(record[15]))))
  </code></pre>
  
  <p>and the error that comes up is:</p>
  
  <pre><code>File "mySQLtest.py", line 165, in &lt;module&gt;
      cursor.execute("""UPDATE evaluation SET M=%s WHERE A LIKE %s""",(progress, int(str(record[15]))))
    File "/usr/lib64/python2.5/site-packages/MySQLdb/cursors.py", line 166, in execute
      self.errorhandler(self, exc, value)
    File "/usr/lib64/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
      raise errorclass, errorvalue
  _mysql_exceptions.OperationalError: (1205, 'Lock wait timeout exceeded; try restarting transaction')
  </code></pre>
  
  <p>I am not sure where this is going wrong, as I said this code worked until recently.  If anyone has any suggestions they would be much appreciated! (I replaced variables with letters to aid read-ability!)</p>
  
  <p>The database is connecting correctly, as I can output the "result" after cursor.fetchall()</p>
  
  <p>Thanks in advance</p>