db=MySQLdb.connect(host=’localhost’,user=’root’, passwd=’xxxxx’,db=’dbname’) cur=db.cursor() cur.execute(‘select * from records’)打印所有执行结果rs=cur.fetchall() for r in rs: print r打印一条数据的所有字段信息rs=cur.fetchone() for r in range(1,n): print list(rs)[i]