MySQL Remote Connection (Replication)

2019-04-15 03:09发布

问题:

I have the following topology. One Ubuntu 16.04. Instance on the Amazon AWS where my global MySQL Server is running. I want to use this Server as a Slave (Multi-Source Replication) for many local Master (Windows Machines MySQL Server).

For Testing Reasons I`ve Managed to make this running on one local Machine (with three different MySQL Server Running).

But now I want to make this Replication work on the mentioned global Server with the local ones. But it fails on the attempt to connect from the EC2 ubuntu Instance to the local Windows MySQL Server.

When I try to connect from my EC2 Instance to the local Computer with MySQL running on Port 3307 it keep saying: ERROR 2003 (HY000): Can't connect to MySQL server on (113)

The strange Part is, that I can PING the Local Computer but not telnet it. Telnet just says: telnet: Unable to connect to remote host: No route to host

I can access the Global (EC2 / Ubuntu MySQL Server) from the local Machine but not the other way around.

I`ve already made a new Rule for this Port on the Windows Firewall Settings.

But the Port 3307 on the IPv4 Address seems to be still Closed.

I have no clue what I am missing to get a Connection from the EC2 Instance to my local Computer via TCP.

Do I have to open the Port Specific on the Router?

I hope for your help. Best Regards.

回答1:

It seems like your local computer is not visible as your incoming ports to your local pc are closed. it may be a problem with your router or your internet service provider Who is not allowing you to open ports.

The possible solution is: 1.if your ports are not open due to the router 1.)Try forwarding required ports to your pc. 2.)Try Switching off your NAT firewall that may be blocking ports. 3.)Try switching off your windows or antivirus firewall if any.

2.if your ports are blocked by your Internet service provider. 1.)Try getting help from ISP 2.)Switch to a static IP connection if on dynamic. 3.)Use a VPN service that provides an unblocked port service to all IPs.(This one solved my problem when I was struck in this situation.)