MySQL Connector/Python Developer Guide

10.2.6 MySQLConnection.cursor() Method

Syntax:

cursor = cnx.cursor([arg=value[, arg=value]...])

This method returns a MySQLCursor() object, or a subclass of it depending on the passed arguments. The returned object is a cursor.CursorBase instance. For more information about cursor objects, see Section 10.5, “cursor.MySQLCursor Class”, and Section 10.6, “Subclasses cursor.MySQLCursor”.

Arguments may be passed to the cursor() method to control what type of cursor to create:

The returned object depends on the combination of the arguments. Examples: