服务端迁移到新地址,MySQL 对外端口改 3307

宿主机 3306 已被 1Panel 的 MySQL 占用,compose 起不来导致后端连不上库、
登录接口 500。容器间仍走 mysql:3306 内网,仅宿主机映射改为 3307。
This commit is contained in:
2026-10-20 22:40:12 +08:00
parent 7cdfd76bfb
commit ee008c5915
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -19,7 +19,9 @@ services:
- --default-authentication-plugin=mysql_native_password
- --max-allowed-packet=64M
ports:
- "3306:3306"
# 宿主机 3306 已被 1Panel 的 MySQL 占用,这里对外映射到 3307;
# 容器间通信走 compose 内网,server 仍连 mysql:3306,不受此映射影响
- "3307:3306"
volumes:
- mysql_data:/var/lib/mysql
# 数据库初始化:仅在全新数据卷首次启动时执行 docs/schema.sql(服务端不再自动建表)