import MySQLdb, sys, configparser, time, subprocess, codecs, os
from main_config import main_Config

def mysql_initialize(project):
    mysql_id, mysql_pass, projects, root_path, using_os = main_Config()

    try:
        conn=MySQLdb.connect(db=project, user=mysql_id, passwd=mysql_pass, charset="utf8mb4")
        cursor=conn.cursor()

        time.sleep(0.1)

        sql="update text_table set sentence_vector = NULL"
        cursor.execute(sql)

        time.sleep(0.1)


        sql="update text_table set train_test_data = NULL"
        cursor.execute(sql)

        time.sleep(0.1)

        conn.commit()
        cursor.close()
        conn.close()

    except  Exception as e:
        print(e)
