pymysql 查询大量数据导致内存使用过高优化方案

import pymysql,random,datetime
conn = pymysql.connect(database="wetest", user="bms", password="bms@2018", host="123.156.187.154", port=3306,charset="utf8")
cursor = conn.cursor(cursor=pymysql.cursors.SSDictCursor)
sql = """
    select    *   from     vul_detail 

"""
cursor.execute(sql)
while True:
     row = cursor.fetchone()
     if not row:
         break
     print(row)
posted @ 2020-07-17 10:17  离人怎挽_wdj  阅读(736)  评论(0编辑  收藏  举报