doubang4881 2016-11-22 05:17
浏览 67

集中式Mysql DB

I need solution for Centralized DB.

We have DB in one Hosting server (Azure Redhat virtual server) and we need to use the same db in other hosting server too. So it will be centralized DB for both server. I can not use it in navicat also if I use IP of Mysql DB.

I have tried using ( bind-address= IP address of the server where db is hosted ) in My.cnf file but it doesn't allow remote access. to use it in other hosting server nor in any mysql client like navicat / Heidi sql.

Also I have added the port 3306 rule in azure server for inbound security.

Thanks in advance for help.

  • 写回答

1条回答 默认 最新

  • doushenjia8514 2016-11-22 08:05
    关注

    As Azure VMs disable ICMP and we can use SSH tunnels to allow outside access to internal network resources.

    Please try to follow this post, created a SSH tunnel in VM which hosted the MySQL server:

    • Open port 3306, so a remote client can connect to your MySQL Server. Run the following command to open TCP port 3306

      iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

      Now let’s check if the port 3306 is open by running this command:

      sudo netstat -anltp|grep :3306

    • Create a SSH tunnel for port 3307

      sudo ssh -fNg -L 3307:127.0.0.1:3306 azurevmuser@servername

    • Create an endpoint for the port 3307 rule in azure server for inbound security. Now your Database host name is <VM_ip>:3307

    Any further concern, please feel free to let me know.

    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)