I think the problem is that you want to call connect(), not connection():
conn = MySQLdb.connect(...)
See PEP249. I'm not sure what connection() gives you but it appears to be something else...
Leo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all, i tried to run the following:
>>> import MySQLdb
>>> db = MySQLdb.connection(user="root", db="test")
>>> db.cursor()
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
db.cursor()
AttributeError: cursor
>>>
Can someone tell me what could be wrong with that?
I'm running python 2.5 on mac intel with the latest release of mysqldb (as of 2 weeks ago)
thanks a lot!
Jason
thanks a lot!
for some reason i read a random code snippet online about MySQLdb and just copied some of their initialization stuff...
it fixed my problem :D
I think the problem is that you want to call connect(), not connection():
conn = MySQLdb.connect(...)
See PEP249. I'm not sure what connection() gives you but it appears to be something else...
Leo