ImportError: No module name MySQLdb

Fred fredg at
Thu Jan 26 14:03:30 CET 2006

Re-reading my message I noticed a stupid error, not effecting my
problem but annoying, I assigned variables and then did not use them,
then included import cgi for my regular script. This is how the command
line script should look:

import MySQLdb

db=MySQLdb.connect(host = '', db = 'phone')
cursor.execute("Select * from phone")
result = cursor.fetchall()
for record in result:
  print record[0],record[1],record[2]

More information about the Python-list mailing list