22 lines
625 B
Python
22 lines
625 B
Python
import mysql.connector
|
|
|
|
hosts = ["localhost", "dsm.chemifactory.com"]
|
|
ports = [3306, 3307]
|
|
|
|
for host in hosts:
|
|
for port in ports:
|
|
print(f"Trying {host}:{port}...")
|
|
try:
|
|
conn = mysql.connector.connect(
|
|
host=host,
|
|
port=port,
|
|
user="ctnt_root",
|
|
password="Umsang6595!!",
|
|
database="carbon_cutting_mc_db",
|
|
connection_timeout=3
|
|
)
|
|
print(f"SUCCESS: Connected to {host}:{port}!")
|
|
conn.close()
|
|
except Exception as e:
|
|
print(f"FAILED {host}:{port}: {e}")
|