-2

I have a server in internet that must have all data synced (dont need to be in realtime) from a server from a intranet (obviously has internet connection). Is it possible?

How about sync both sides, master-master?

I havent tried yet because my internal server is behind a NAT and I dont have access to it.

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47

2 Answers2

2

Two ways to do it:

  1. Configure the NAT router to forward the MySQL port (3306/tcp) from the internet to your intranet server. In general this is a risky thing to do; obviously you don't want the whole internet to be able to connect to your database server. So you'll need strong authentication, and strong encryption too as EEAA said.

  2. Have a client inside the LAN connect out by ssh to the internet server, then tunnel port 3306 over that connection back to the intranet MySQL server:

    ssh -R 3306:intranetmysql:3306 internetmysql
    
Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
1

I have a server in internet that must have all data synced (dont need to be in realtime) from a server from a intranet (obviously has internet connection). Is it possible?

Yes.

How about sync both sides, master-master?

Yes.

You need to consider encryption, though, as you don't want cleartext data going out over the internet.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • Will also need to consider bandwidth requirements. A large heavily used db with a 56k modem between the servers will never catch up. – Grant Jan 08 '14 at 19:04