Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_sync.py中因为密码含有特殊符号(如@)而初始化表结构失败 #34

Open
heyxun opened this issue Dec 29, 2024 · 2 comments

Comments

@heyxun
Copy link

heyxun commented Dec 29, 2024

你好,

engine创建那块代码可以修改成如下代码:

from sqlalchemy.engine.url import URL

url_object = URL(
    drivername='mysql+pymysql',
    username=default_configs.get(const.DBUSER_KEY),
    password=default_configs.get(const.DBPWD_KEY),
    host=default_configs.get(const.DBHOST_KEY),
    port=int(default_configs.get(const.DBPORT_KEY)),
    database=default_configs.get(const.DBNAME_KEY),
    query={'charset': 'utf8mb4'}
)
engine = create_engine(url_object, echo=True)
@heyxun heyxun changed the title db_sync.py中因为密码含有特殊符号(如@)而创建数据库失败 db_sync.py中因为密码含有特殊符号(如@)而初始化表结构失败 Dec 29, 2024
@ss1917
Copy link
Contributor

ss1917 commented Dec 30, 2024

多谢,我需要统一升级一下SQLAlchemy 版本

@ss1917
Copy link
Contributor

ss1917 commented Dec 30, 2024

这个需要升级SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants