MySQL连接器/Python发布说明
在大多数情况下,MySQLConnection
光标()
方法实例化MySQLCursor
对象:
进口mysql。连接mysql.connector.connect(database='world')
也可以通过传递参数来实例化游标MySQLConnection
对象MySQLCursor
:
进口mysql。mysql.connect (database='world') cursor = MySQLCursor(cnx)
connection参数是可选的。如果省略,则创建游标execute ()
方法引发异常。