21 lines
553 B
Python
21 lines
553 B
Python
import pymysql
|
|
|
|
try:
|
|
connection = pymysql.connect(
|
|
host='140.245.211.174',
|
|
user='appuser',
|
|
password='Seekright@123',
|
|
database='Maple_Highways',
|
|
port=3306,
|
|
cursorclass=pymysql.cursors.DictCursor
|
|
)
|
|
|
|
with connection.cursor() as cursor:
|
|
cursor.execute("DESCRIBE tbl_site_anomaly")
|
|
result = cursor.fetchall()
|
|
for row in result:
|
|
print(f"{row['Field']} - {row['Type']}")
|
|
finally:
|
|
if 'connection' in locals() and connection.open:
|
|
connection.close()
|