mirror of
https://github.com/KingHWJ/WeReadBoard.git
synced 2026-11-03 18:24:58 +08:00
chore(config): 切换项目数据源到远程 MySQL
This commit is contained in:
1 parent
d33601c987
commit
aee8c58b04
3 files changed
+153
-7
No files matched your search
@@ -51,11 +51,12 @@ app.register_blueprint(v2_bp)
|
||||
# 数据库连接配置
|
||||
# ======================================================================
|
||||
MYSQL_CONFIG = {
|
||||
"host": "127.0.0.1", # MySQL 服务器地址
|
||||
"port": 3306, # MySQL 端口
|
||||
"user": "root", # 数据库用户名
|
||||
"password": "258963", # 数据库密码
|
||||
"database": "weread_dashboard", # 数据库名称
|
||||
# 默认使用远程 MySQL;仍可通过 WEREAD_DB_* 环境变量覆盖
|
||||
"host": os.environ.get("WEREAD_DB_HOST", "124.222.38.85"),
|
||||
"port": int(os.environ.get("WEREAD_DB_PORT", 13306)),
|
||||
"user": os.environ.get("WEREAD_DB_USER", "root"),
|
||||
"password": os.environ.get("WEREAD_DB_PASSWORD", "258963"),
|
||||
"database": os.environ.get("WEREAD_DB_NAME", "weread_dashboard"),
|
||||
"charset": "utf8mb4", # 字符集(支持完整 Unicode 含 emoji)
|
||||
"cursorclass": pymysql.cursors.DictCursor, # 使用字典游标,方便按字段名取值
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user