36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
# Changelog — WSL MySQL 连接 + 建表 + MCP 配置
|
||
|
||
**日期**: 2026-05-22
|
||
**类型**: 配置 / 数据库初始化
|
||
|
||
## 变更摘要
|
||
|
||
1. 确认 WSL 可连接 `172.31.170.47:3306`,库 `nexus` 已存在但无表
|
||
2. 执行 `scripts/bootstrap_database.py` 创建 **16 张表**
|
||
3. `server/config.py`:`SettingsConfigDict(extra="ignore")`,允许 `.env` 共存 `MYSQL_*`
|
||
4. `.cursor/mcp.json` 改为经 **WSL** 启动 `mysql-mcp-server`
|
||
5. 新增 `scripts/wsl_check_mysql.py`、`scripts/bootstrap_database.py`
|
||
|
||
## 表结构(已创建)
|
||
|
||
`admins`, `audit_logs`, `command_logs`, `db_credentials`, `login_attempts`, `nodes`, `password_presets`, `platforms`, `push_retry_jobs`, `push_schedules`, `script_executions`, `scripts`, `servers`, `settings`, `ssh_sessions`, `sync_logs`
|
||
|
||
## 涉及文件
|
||
|
||
- `server/config.py`
|
||
- `.cursor/mcp.json`
|
||
- `scripts/wsl_check_mysql.py`, `scripts/bootstrap_database.py`
|
||
- `docs/project/mysql-mcp-setup.md`
|
||
|
||
## 验证(WSL)
|
||
|
||
```bash
|
||
python3 scripts/wsl_check_mysql.py
|
||
# 应显示 TABLES in nexus (16): [...]
|
||
```
|
||
|
||
## 备注
|
||
|
||
- 数据迁移 `migrate_category_to_node` 首次可能因连接池 ping 报错(无历史数据可忽略)
|
||
- Cursor 需 Reload Window 后 MCP 走 WSL 读 `.env`
|