fix: 修复 MySQL 连接配置并合并数据库迁移文件

- 修复 MySQL 连接配置
  - 添加 allowPublicKeyRetrieval=true 参数(解决 Public Key Retrieval 错误)
  - 将 characterEncoding=utf8mb4 改为 utf8(兼容性修复)
  - 更新所有配置文件:docker-compose.yml, deploy.sh, docs/DEPLOYMENT.md

- 合并数据库迁移文件
  - 将 V1, V2, V3 迁移文件合并为一个 V1__init_database.sql
  - 删除 V2__create_proxy_config_table.sql
  - 删除 V3__rename_copy_trading_accounts_to_wallet_accounts.sql
  - 新的 V1 包含所有表结构(11 个表)
This commit is contained in:
WrBug
2025-12-03 05:16:44 +08:00
parent 58cc096a77
commit bb671bfd89
8 changed files with 27 additions and 63 deletions
+3 -3
View File
@@ -41,7 +41,7 @@
```bash
# 创建 .env 文件
cat > .env <<EOF
DB_URL=jdbc:mysql://mysql:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8mb4
DB_URL=jdbc:mysql://mysql:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8&allowPublicKeyRetrieval=true
DB_USERNAME=root
DB_PASSWORD=your_password_here
SPRING_PROFILES_ACTIVE=prod
@@ -180,7 +180,7 @@ cd backend
```bash
# 创建 .env 文件
cat > .env <<EOF
DB_URL=jdbc:mysql://mysql:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8mb4
DB_URL=jdbc:mysql://mysql:3306/polyhermes?useSSL=false&serverTimezone=UTC&characterEncoding=utf8&allowPublicKeyRetrieval=true
DB_USERNAME=root
DB_PASSWORD=your_password_here
SPRING_PROFILES_ACTIVE=prod
@@ -213,7 +213,7 @@ docker run -d \
--name polyhermes-backend \
-p 8000:8000 \
-e SPRING_PROFILES_ACTIVE=prod \
-e DB_URL=jdbc:mysql://host.docker.internal:3306/polyhermes?useSSL=false \
-e DB_URL=jdbc:mysql://host.docker.internal:3306/polyhermes?useSSL=false&allowPublicKeyRetrieval=true \
-e DB_USERNAME=root \
-e DB_PASSWORD=your_password \
-e JWT_SECRET=your-jwt-secret \