Updated on 2025-10-23 GMT+08:00

connection.begin()

Description

This method will start a transaction.

By default, begin() is not called, and PyMySQL opens a transaction before the first command is executed. The begin() method provides the capability of manually controlling transactions.

Prototype

connection.begin()

Parameters

None

Return Value

None

Examples

For details, see Examples: Common Operations.