服务端迁移到新地址,MySQL 对外端口改 3307
宿主机 3306 已被 1Panel 的 MySQL 占用,compose 起不来导致后端连不上库、 登录接口 500。容器间仍走 mysql:3306 内网,仅宿主机映射改为 3307。
This commit is contained in:
+3
-1
@@ -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(服务端不再自动建表)
|
||||
|
||||
Reference in New Issue
Block a user