文档介绍(待补充)
import pymysql #链接数据库(梦测数据库) conn = pymysql.connect(host="140.143.203.**",port=3306,user="root",passwd="*est123456.",db="zhaoy",charset="utf8") #创建游标 cur = conn.cursor() #执行SQL cur.execute("select * from adv_info_type ") data = cur.fetchone() data = cur.fetchmany() data = cur.fetchall() print(data) cur.close() conn.commit() conn.close()