Documentation Home
Connectors and APIs Manual
Download this Manual cursor.MySQLCursorRaw Class

The MySQLCursorRaw class inherits from MySQLCursor.

A MySQLCursorRaw cursor skips the conversion from MySQL data types to Python types when fetching rows. A raw cursor is usually used to get better performance or when you want to do the conversion yourself.

To create a raw cursor, use the raw argument when calling a connection's cursor() method. Alternatively, to make all cursors created from the connection raw by default, use the raw connection argument.


import mysql.connector
cnx = mysql.connector.connect()
# Only this particular cursor will be raw
cursor = cnx.cursor(raw=True)
# All cursors created from cnx2 will be raw by default
cnx2 = mysql.connector.connect(raw=True)

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.