1

I am trying to inner join 2 tables located on 2 different MySQL Servers.

I am trying to do something like this:

SELECT id, name FROM server2.db1.account AS new_data
INERT INTO server1.db2.account(id, name) 
ON DUPLICATE KEY UPDATE name = new_data.name

In SQL Server there is link server future which allows you to do this but I am not sure how this is done using MySQL Server.

Note: I need to be able to inner join all the tables from one server to another.

I am looking for a solution where I don't have to do every table separately as I have multiple servers and many tables on each database.

Thanks for your time and help.

James
  • 4,644
  • 5
  • 37
  • 48
Jaylen
  • 39,043
  • 40
  • 128
  • 221

1 Answers1

0

Go read about the federated engine. It is the MySQL version of linked servers. You will be able to query a remote table like a local table using the federated engine. Read this link.

Namphibian
  • 12,046
  • 7
  • 46
  • 76