I\'m new to Python and Python\'s MySQL adapter. I\'m not sure if I\'m missing something obvious here:
db = MySQLdb.connect(# db details omitted)
cursor = se
I'd guess that you are using a storage engine that supports transactions (e.g. InnoDB) but you don't call db.commit()
after the DELETE. The effect of the DELETE is discarded if you don't commit.
See http://mysql-python.sourceforge.net/FAQ.html#my-data-disappeared-or-won-t-go-away:
Starting with 1.2.0, MySQLdb disables autocommit by default, as required by the DB-API standard (PEP-249). If you are using InnoDB tables or some other type of transactional table type, you'll need to do connection.commit() before closing the connection, or else none of your changes will be written to the database.
See also this similar SO question: Python MySQLdb update query fails