python pymysql set autocommit false fails

我与影子孤独终老i 提交于 2019-12-05 18:41:16

Transactions are not supported with MyISAM storage engine in MySQL. Only InnoDB suports ACID transactions.

Quoting Transactions and Atomic Operations MySQL documentation:

In transactional terms, MyISAM tables effectively always operate in autocommit = 1 mode.

You should check storage engine for your tables:

mysql> SELECT table_name,engine FROM INFORMATION_SCHEMA.TABLES 
       WHERE table_schema=DATABASE();
+--------------+--------+
| table_name   | engine |
+--------------+--------+
| stats        | MyISAM |
+--------------+--------+
1 row in set (0.00 sec)

Move tables to a MySQL storage engine that supports transactions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!