Mysql
 SQL >> Database >  >> RDS >> Mysql

Evitare Commands out of sync MySQLdb Python

DB-API gestisce transazioni automaticamente, iniziando una transazione al primo comando e richiedendo commit esplicito.

cursor.execute("CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT)"); cursor.commit();

Questo può rendere difficile eseguire comandi fuori transazione o controllare in modo granulare le transazioni.