Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.1Mb
PDF (A4) - 4.1Mb MySQLConnection.autocommit Property

This property can be assigned a value of True or False to enable or disable the autocommit feature of MySQL. The property can be invoked to retrieve the current autocommit setting.


Autocommit is disabled by default when connecting through Connector/Python. This can be enabled using the autocommit connection parameter.

When the autocommit is turned off, you must commit transactions when using transactional storage engines such as InnoDB or NDBCluster.

>>> cnx.autocommit
>>> cnx.autocommit = True
>>> cnx.autocommit