1Panel-dev / 1Panel-dev/1Panel

[Feature] When adding a remote MySQL server, can the database address support using a container name?

Open
#11,596 1 comment 0 reactions 2 assignees View on GitHub

@ssongliu is already working on this.

Since Feb 2, 2026.

type: optimization
Dominant language
Go
Stars
37k
Forks
3.4k
Avg merge
9h 16m
Merged PRs (30d)
105

Description

1Panel Version

v2.0.16

Please describe your needs or suggestions for improvements

我这边的 MySQL 容器不是通过 1Panel 安装的。之后通过“添加远程服务器”纳入 1Panel 管理,并加入到 1panel-network 网络,已映射宿主机 3306 端口。这样在安装其他 Docker 应用时,就可以在 1Panel 内选择这个 MySQL。

问题在于:在添加远程服务器时,我填写的数据库 IP 为宿主机 IP,比如 10.0.0.199 或 127.0.0.1,安装 WordPress 后会提示“数据库连接异常”。

如果我改用 1panel-network 内部分配给 MySQL 容器的 IP,可以连接。不过这个 IP 会随着 Docker 重启而变化,不稳定。我目前的做法是修改.env 改为mysql容器名,再执行 docker compose up。

因此我的诉求是:在添加远程服务器 - 数据库地址时,希望支持填写容器名,而不仅仅是 IP 地址。

Image
Please describe the solution you suggest

数据库地址 支持容器名后,安装其他docker 不需要额外的配置

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.