You are using the low-level C API wrapper (not sure why). Most people,
I believe, would use the pythonic API:
>>> import MySQLdb
>>> db = MySQLdb.connect(host='localhost', user='root', passwd='mypw',
db='python-test')
>>> cursor = db.cursor()
The low-level API is... well.. for when you want to do low-level stuff.
You probably want the pythonic API.
-a