ImportError: No module name MySQLdb

Fred fredg at fastmail.fm
Thu Jan 26 08:03:30 EST 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:

 #!/usr/bin/python
import MySQLdb

db=MySQLdb.connect(host = '192.168.0.112', db = 'phone')
cursor=db.cursor()
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