#数据库连接--获取游标--执行sql语句--获取结果--打印
#!/user/bin/env
import MySQLdbdb = MySQLdb.connect(host='localhost',user='root',passwd='316316',db='nowasp')
cursor=db.cursor()
cursor.execute("select * from accounts")
result = cursor.fetchall()
for record in result:
print record[0] ,record[1], record[2], record[3]