import pymysql
conn = pymysql.connect(host='localhost',user='root',password='123',db='db1',charset='utf8')
cur = conn.cursor()
cur.execute('SELECT * FROM user')
for row in cur.fetchall():
print(row)
conn.close()
import pymysql
conn = pymysql.connect(host='localhost',user='root',password='123',db='db1',charset='utf8')
cur = conn.cursor()
cur.execute('SELECT * FROM user')
for row in cur.fetchall():
print(row)
conn.close()