# -*- coding: utf-8 -*- import io, sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') import pymysql c = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456', database='crm', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor) cur = c.cursor() cur.execute("SHOW COLUMNS FROM customer_import_fail") print('FAIL COLS:', [(r['Field'], r['Type']) for r in cur.fetchall()]) cur.execute("SHOW COLUMNS FROM customer WHERE Field IN ('is_biz_negotiated','is_child')") print('CUST COLS:', [(r['Field'], r['Type'], r['Null'], r['Default']) for r in cur.fetchall()]) c.close()