10bet网址
MySQL连接器/Python开发者指南
相关的文档10bet官方网站 下载本手册

10.5.1游标。MySQLCursorConstructor

在大多数情况下,MySQLConnection光标()方法实例化MySQLCursor对象:

进口mysql。连接mysql.connector.connect(database='world')

也可以通过传递参数来实例化游标MySQLConnection对象MySQLCursor

进口mysql。mysql.connect (database='world') cursor = MySQLCursor(cnx)

connection参数是可选的。如果省略,则创建游标execute ()方法引发异常。