Ai_GirlFriend/验证.py

16 lines
446 B
Python
Raw Normal View History

2026-02-28 09:40:18 +08:00
import pymysql
conn = pymysql.connect(host='localhost', port=3306, user='root', password='rootx77', database='ai_friend', charset='utf8mb4')
cursor = conn.cursor()
cursor.execute("SHOW TABLES")
tables = cursor.fetchall()
print(f"{len(tables)} 张表")
for t in ['nf_user', 'nf_lovers', 'nf_chat_message']:
cursor.execute(f"SHOW TABLES LIKE '{t}'")
print(f"{'' if cursor.fetchone() else ''} {t}")
cursor.close()
conn.close()