import pymysql
import cv2
import numpy as np
conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='1234567890', db='studentmemo')
cursor = conn.cursor()
cursor.execute("SELECT pic FROM student_abnormal")
with open('lc2.jpg', 'wb') as f:
f.write(cursor.fetchone()[0])
print(cursor.fetchone())