infatti, probabilmente l'errore era quello, guarda qui:

http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html