You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
745 B
15 lines
745 B
# -*- coding: utf-8 -*-
|
|
import pymysql, io, sys
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
|
|
database='crm', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
|
|
with conn.cursor() as cur:
|
|
for t in ("customer", "customer_contact", "customer_member", "customer_follow",
|
|
"customer_transfer", "customer_transfer_detail", "import_task", "contact_import_task"):
|
|
try:
|
|
cur.execute("SHOW COLUMNS FROM " + t)
|
|
cols = [r["Field"] for r in cur.fetchall()]
|
|
print(t, "→", cols)
|
|
except Exception as e:
|
|
print(t, "ERR", e)
|
|
conn.close()
|
|
|