集中式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.

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.