This method sends the COMMIT
command to the
MySQL server, committing the current transaction. Since by
default, Connector/Python does not auto commit, it is important
to call this method after every transaction which updates data
for tables using transactional storage engines.
See the rollback() method for rolling back transactions.
>>> cursor.execute("INSERT INTO employees (first_name) VALUES (%s)", ('Jane')) >>> cnx.commit()