Mysql:检索大数据时游标fetchall()返回随机字符

时间:2019-06-17 05:17:18

标签: mysql python-3.x flask-mysql

为什么在检索大量数据时cursor.fetchall()返回一些随机字符?

enter image description here

这是我的python代码:

conn = mysql.connect()
cursor = conn.cursor()
#execute query
cursor.execute("SELECT loanID FROM lending_loandetails")
rv = cursor.fetchall()
json_data=list()
for result in rv:
   json_data.append({'pnid': result[0]})

return jsonify(json_data)

0 个答案:

没有答案