16 lines
446 B
Python
16 lines
446 B
Python
|
|
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()
|