# -*- coding: utf-8 -*-
'''Chinese comments are used below, need to be added'''
# Author: xiaolong.shi
# Email: xiaolong@zamplus.com

import GeoCode

class AddGeocode(object):

def __init__(self):
self.geocode = GeoCode()
self.mismath_num = 0
self.db = pymysql.connect(host='172.22.64.50',user='xialong',password='adiiadsjkh',db='knowledgebase',charset='utf8')
# 流式游标
self.cursor = self.db.cursor(cursor=pymysql.cursors.SSDictCursor)

def modify(self):
"""
查询省市区错乱的数据,并修改导入数据库
"""
sql = 'SELECT * FROM kb_mall;'
self.cursor.execute(sql)
while True:
row = self.cursor.fetchone()
if not row:
break
print(row)

mysql查询大数据,遍历大数据,流式查询