Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.6Mb
PDF (A4) - 0.6Mb
EPUB - 137.6Kb
HTML Download (TGZ) - 85.2Kb
HTML Download (Zip) - 103.1Kb


10.5 cursor.MySQLCursor Class

The MySQLCursor class instantiates objects that can execute operations such as SQL statements. Cursor objects interact with the MySQL server using a MySQLConnection object.

To create a cursor, use the cursor() method of a connection object:

import mysql.connector

cnx = mysql.connector.connect(database='world')
cursor = cnx.cursor()

Several related classes inherit from MySQLCursor. To create a cursor of one of these types, pass the appropriate arguments to cursor():


User Comments
Sign Up Login You must be logged in to post a comment.