db=pymysql.connect("ip地址","用户名","密码","数据库")
cursor=db.cursor()
cursor.execute("select * from zj_class limit 5")
data=cursor.fetchall()
for i in range(5):
print(data[i])
db.close()
db=pymysql.connect("ip地址","用户名","密码","数据库")
cursor=db.cursor()
cursor.execute("select * from zj_class limit 5")
data=cursor.fetchall()
for i in range(5):
print(data[i])
db.close()