| 123456789101112131415161718192021222324252627282930313233 |
- # -*- coding: utf-8 -*-
- """查看登录相关表结构"""
- import re
- import pymysql
- from pathlib import Path
- yml = Path(r"C:\Users\Administrator\WorkBuddy\2026-10-17-12-27-10\java-rewrite\yoshop-java\src\main\resources\application.yml")
- text = yml.read_text(encoding="utf-8")
- pwds = re.findall(r"password:\s*(.+)", text)
- pwd = pwds[0].strip().strip('"\'')
- conn = pymysql.connect(host="192.168.1.177", port=3306, user="root", password=pwd, database="shop")
- cur = conn.cursor()
- for t in ("yoshop_store_user", "yoshop_store", "yoshop_store_role"):
- print("=" * 20, t)
- cur.execute(
- "SELECT column_name, column_type, is_nullable, column_default FROM information_schema.columns "
- "WHERE table_schema='shop' AND table_name=%s ORDER BY ordinal_position", (t,))
- for cn, ct, nl, df in cur.fetchall():
- print(f" {cn:22s} {ct:20s} null={nl} default={df}")
- print("\n=== store_user 数据 ===")
- cur.execute("SELECT store_user_id, user_name, real_name, is_super, is_delete, store_id, LEFT(password,10) FROM yoshop_store_user")
- for r in cur.fetchall():
- print(r)
- print("\n=== store 数据 ===")
- cur.execute("SELECT store_id, store_name, is_delete, is_recycle FROM yoshop_store")
- for r in cur.fetchall():
- print(r)
- conn.close()
|