MySQL端口在将绑定地址更改为服务器的私有地址后显示近距离

发布于 2025-02-10 07:56:29 字数 607 浏览 2 评论 0原文

我正在使用数字海洋的液滴,我想通过工作台访问我的数据库。早些时候,我正在使用Google的计算引擎具有相同的设置,例如将Bind-Address更改为Server的Private-IP,然后使用与主机相同的IP创建用户。示例

my.cnf

port = 3306
bind-address = 10.223.0.1
  

mysql用户,

CREATE USER 'adam'@'10.223.0.1' IDENTIFIED BY 'abc@123';
GRANT ALL PRIVILEGES ON *.* TO 'adam'@'10.223.0.1' WITH GRANT OPTION;

我能够使用服务器的外部IP在本地计算机上访问此用户。

但是现在,如果我使用私有IP更新绑定地址,并使用外部端口检查器工具进行检查。它告诉我,端口3306已关闭,如果我更改为0.0.0.0,端口显示的端口显示开放,我就可以访问。但是问题是,我要添加更新的私有IP,因为我想将数据库复制到另一台服务器。我如何解决这个问题。

允许使用3306 IPv4 IPv6的UFW,而液滴防火墙也有3306的入站规则,也要

提前感谢您。

I am using Digital Ocean's droplet I want to access my database though my workbench. Earlier I was using Google's compute engine with same settings like changing bind-address to server's private-ip and then creating user with same ip as a host. Example

my.cnf

port = 3306
bind-address = 10.223.0.1
  

mysql user

CREATE USER 'adam'@'10.223.0.1' IDENTIFIED BY 'abc@123';
GRANT ALL PRIVILEGES ON *.* TO 'adam'@'10.223.0.1' WITH GRANT OPTION;

I was able to access this user on my local machine with the use of server's external IP.

But now if I update bind-address with my private IP and check with external port checker tool. it tells me that port 3306 is closed and if I change to 0.0.0.0 than port shows open and I am able to access. But the thing is, I am adding updating private ip as I want to replicate my database to another server. how I can solve this.

Ufw is allowed for 3306 ipv4 ipv6 and droplet firewall have inbound rules for 3306 too

Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

伪装你 2025-02-17 07:56:29

解决了,我创建了SSH连接隧道以远程连接MySQL,并将绑定地址保留为服务器的私有IP。

Solved, I created SSH connection tunnel to connect mysql remotely and kept my bind-address as server's private IP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文