python mysql.connector DictCursor?

According to this article it is available by passing in ‘dictionary=True’ to the cursor constructor:
http://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursordict.html

so I tried:

cnx = mysql.connector.connect(database="bananas")
cursor = cnx.cursor(dictionary=True)

and got:
TypeError: cursor() got an unexpected keyword argument ‘dictionary’

and I tried:

cnx = mysql.connector.connect(database="bananas")
cursor = cnx.cursor(named_tuple=True)

and got:
TypeError: cursor() got an unexpected keyword argument ‘named_tuple’

and I tried this one too: cursor = MySQLCursorDict(cnx)

but to no avail. Clearly I’m on the wrong version here and I suspect we just have to be patient as the document at http://downloads.mysql.com/docs/connector-python-relnotes-en.a4.pdf suggests these new features are in alpha phase at point of writing.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)