z230
This commit is contained in:
24
40 Fio 02 diagnostika 2.py
Normal file
24
40 Fio 02 diagnostika 2.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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"])
|
||||
Reference in New Issue
Block a user