我认为您必须连接传递
cursorclass = MySQLdb.cursors.SSCursor:
MySQLdb.connect(user="user", passwd="password", db="mydb", cursorclass = MySQLdb.cursors.SSCursor )
即使您不使用,默认光标也会一次获取所有数据
fetchall。
编辑:
SSCursor或支持服务器端结果集的任何其他游标类-检查上的模块文档
MySQLdb.cursors。

我认为您必须连接传递
cursorclass = MySQLdb.cursors.SSCursor:
MySQLdb.connect(user="user", passwd="password", db="mydb", cursorclass = MySQLdb.cursors.SSCursor )
即使您不使用,默认光标也会一次获取所有数据
fetchall。
编辑:
SSCursor或支持服务器端结果集的任何其他游标类-检查上的模块文档
MySQLdb.cursors。