import MySQLdb

conn = MySQLdb.connect(host="localhost", \
                       user="root", \
                       passwd="root", \
                       db="TestDB")
cursor = conn.cursor()
cursor.execute("select * from Users")
res = cursor.fetchall()
print res
cursor.close()
conn.close()
posted on 2013-04-19 19:52  andy071001  阅读(150)  评论(0编辑  收藏  举报