_verify_remote_tables.py 662 B

12345678910111213
  1. import pymysql
  2. conn = pymysql.connect(host='123.60.180.165', port=3306, user='aidopremote', password='1234567890aiDOP#', charset='utf8mb4', autocommit=True)
  3. try:
  4. with conn.cursor() as cur:
  5. cur.execute("SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='aidopdev' AND table_name LIKE 'ado\\_%'")
  6. c = cur.fetchone()[0]
  7. print(f"ado_* table count: {c}")
  8. cur.execute("SELECT table_name FROM information_schema.tables WHERE table_schema='aidopdev' AND table_name LIKE 'ado\\_%' ORDER BY table_name")
  9. rows = [r[0] for r in cur.fetchall()]
  10. for r in rows:
  11. print(r)
  12. finally:
  13. conn.close()