Loading

show tables

def list_table(localhost, username, password, database):
    db = pymysql.connect(localhost, username, password, database, charset="utf8")
    cursor = db.cursor()
    cursor.execute("show tables")
    table_list = [tuple[0] for tuple in cursor.fetchall()]
    db.close()
    return table_list
posted @ 2022-04-06 12:39  英俊的少年  阅读(91)  评论(0编辑  收藏  举报