10.6.3 cursor.MySQLCursorBufferedRaw 类

该类MySQLCursorBufferedRaw继承自 MySQLCursor.

MySQLCursorBufferedRaw游标类似于 游标,但 有MySQLCursorRaw 缓冲:执行查询后,它从服务器获取整个结果集并缓冲行。有关缓冲影响的信息,请参阅 第 10.6.1 节,“cursor.MySQLCursorBuffered Class”

要创建缓冲原始游标,请在调用连接 方法时使用raw 和参数。或者,要使所有从连接创建的游标默认为原始游标和缓冲游标,请使用 和连接参数bufferedcursor()rawbuffered

例子:

import mysql.connector

cnx = mysql.connector.connect()

# Only this particular cursor will be raw and buffered
cursor = cnx.cursor(raw=True, buffered=True)

# All cursors created from cnx2 will be raw and buffered by default
cnx2 = mysql.connector.connect(raw=True, buffered=True)