Skip to content

Commit

Permalink
fix(core): Fix metadata mysql url bug (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc authored Dec 15, 2023
1 parent aed1c3f commit 27536f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbgpt/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _initialize_db(try_to_create_db: Optional[bool] = False) -> str:
default_meta_data_path = os.path.join(PILOT_PATH, "meta_data")
os.makedirs(default_meta_data_path, exist_ok=True)
if CFG.LOCAL_DB_TYPE == "mysql":
db_url = f"mysql+pymysql://{quote(CFG.LOCAL_DB_USER)}:{urlquote(CFG.LOCAL_DB_PASSWORD)}@{CFG.LOCAL_DB_HOST}:{str(CFG.LOCAL_DB_PORT)}"
db_url = f"mysql+pymysql://{quote(CFG.LOCAL_DB_USER)}:{urlquote(CFG.LOCAL_DB_PASSWORD)}@{CFG.LOCAL_DB_HOST}:{str(CFG.LOCAL_DB_PORT)}/{db_name}"
else:
sqlite_db_path = os.path.join(default_meta_data_path, f"{db_name}.db")
db_url = f"sqlite:///{sqlite_db_path}"
Expand Down

0 comments on commit 27536f7

Please sign in to comment.