import pymysql
#创建连接
conn = pymysql.connect(host='localhost',port=3306,user='root',passwd='123',db='mysql')
#创建游标
cursor = conn.cursor()
#执行命令
effect_row =cursor.execute('select * from student')
print(cursor.fetchall())
2022-11-27 13:15:22
import pymysql
#创建连接
conn = pymysql.connect(host='localhost',port=3306,user='root',passwd='123',db='mysql')
#创建游标
cursor = conn.cursor()
#执行命令
effect_row =cursor.execute('select * from student')
print(cursor.fetchall())