Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.5Mb
PDF (A4) - 4.5Mb


6.9.2.35 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.

Note

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
False
>>> cnx.autocommit = True
>>> cnx.autocommit
True