python 操作数据库
作者:互联网
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())
标签:fetchall,python,创建,数据库,游标,pymysql,cursor,操作,conn 来源: https://blog.csdn.net/weixin_42989285/article/details/114987299