MySQL: Create FEDERATED Table to SELECT data from another server (Part 3/4)

Previously we have seen a basic theory and configuration of FEDERATED table. In this post, I am showing to create a FEDERATED table which is used to SELECT data from another MySQL Server.

How to create FEDERATED Tables?

Assume that we have two running servers, either both on the same host or different hosts.

For example,

We have two different servers,
Server – A108 (Remote MySQL Server)
Server – B108 (Local MySQL Server)

We require to execute the SELECT command from Server B108 and fetching data from Server A108.
Here, Server A108 is a remote server and Server B108 is a local server.

Now create one sample table in Server A108.

Now create a FEDERATED table in Server B108 to SELECT data from Server A108.
You have to specify FEDERATED engine with remote CONNECTION information.

As you can see, I have created FEDERATED table into Local Server B108 using the connection information of Remote Server A108.

You can access this table like any other table, and if any data insert or delete from remote Table, it automatically updates here because this is a virtual table.

Below is a different format of connection strings:

Anvesh Patel

Leave a Reply

1 Comment on "MySQL: Create FEDERATED Table to SELECT data from another server (Part 3/4)"

Notify of
Sort by:   newest | oldest | most voted

Hi, yeah this article is genuinely nice and I have learned lot of
things from it concerning blogging. thanks.