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:
The code is:
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]))))
and the error that comes up is:
File "mySQLtest.py", line 165, in <module>
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')
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!)
The database is connecting correctly, as I can output the "result" after cursor.fetchall()
Thanks in advance