25 lines
637 B
Python
25 lines
637 B
Python
import pymysql
|
|
from pymysql.cursors import DictCursor
|
|
|
|
conn = pymysql.connect(
|
|
host="192.168.1.76",
|
|
port=3307,
|
|
user="root",
|
|
password="Vlado9674+",
|
|
database="fio",
|
|
charset="utf8mb4",
|
|
cursorclass=DictCursor
|
|
)
|
|
|
|
with conn.cursor() as cur:
|
|
cur.execute("SHOW TABLES;")
|
|
print("📋 Tables:", [r[f"Tables_in_fio"] for r in cur.fetchall()])
|
|
|
|
cur.execute("SELECT COUNT(*) AS cnt FROM transactions;")
|
|
print("🧾 Rows in `transactions`:", cur.fetchone()["cnt"])
|
|
|
|
cur.execute("SHOW COLUMNS FROM transactions;")
|
|
print("\n📊 Columns:")
|
|
for r in cur.fetchall():
|
|
print(" -", r["Field"])
|