无法从我的PC中的MySQL Workbench访问VPS中的MySQL容器
我已经创建了一个docker容器,该容器在其上运行mySQL并将其公开在do液滴(ubuntu 20)上的默认端口(3306)上。
我尝试使用以下参数在笔记本电脑上访问它: 主机名:( VPS的IP地址。我还尝试了公共网关IP) 连接:标准(TCP/IP) 港口:3306 用户名:根 密码:(我在创建容器时设置的密码)
错误消息只是说“无法连接到Localhost” 我是否错过了可能将容器暴露到Internet的步骤?
I've created a docker container that runs MySQL on it and exposes it on the default port (3306) on a DO droplet (Ubuntu 20).
I tried accessing it on my laptop with the following parameters:
Hostname: (VPS's IP address. I also tried Public Gateway IP)
Connection: Standard (TCP/IP)
Port: 3306
Username: root
Password: (Password I have set while creating the container)
The error message just says "Could not connect to localhost"
Am I missing a step that maybe exposes the container to the internet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几个小时后,我发现
docker Run
命令必须具有-p参数。-p = 3306:3306
在我的情况下。After a couple of hours, I found out that the
docker run
command has to have -p parameter.-p=3306:3306
in my case.