Solved

joining two tables from different mysql servers

Posted on 2015-02-10
4
204 Views
Last Modified: 2015-02-12
Dear experts,

I wish to join two database tables with mysql. Here is my scenario.

I have a mysql server at 192.168.55.5 with schema sales and table name order.

I have another mysql server at 192.168.43.44 with schema personnel  and table name customer.

I wish to use a join query to see which customer has what orders.

How can I accomplish this in MySQL? Thanks
0
Comment
Question by:Kinderly Wade
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:Phil Phillips
ID: 40602126
Take a look at the FEDERATED storage engine.  More specifically, look at how to create a FEDERATED table.

In a nutshell, the FEDERATED engine allows you to create local tables that basically pull their data from other databases.  Things to note for the server pulling the data:

You need to make sure that MySQL is compiled with the -DWITH_FEDERATED_STORAGE_ENGINE option
Server needs to be started with the --federated option
0
 

Author Comment

by:Kinderly Wade
ID: 40606639
Hi Phil,

Sorry for the delay reply. Will there be anything else that I need to configure? For example sometimes when I use FEDERATED ENGINE, I will get some timeout for writing and reading the data. For small updates as in row count, few hundred rows are usually fine. If I am going for something like few thousand or few hundred thousand, I will get ERRORS like 1160 or 1159. Will there be another way to resolve it such as changing the my.cnf settings? Thanks.
0
 
LVL 14

Accepted Solution

by:
Phil Phillips earned 500 total points
ID: 40606962
I haven't yet had the chance to use large FEDERATED tables over higher latency links, so I'm not 100% sure on what you would need to configure.

Though, maybe you can try playing around with higher values for 'net_read_timeout', 'net_write_timeout', and 'max_allowed_packet'.
0
 

Author Comment

by:Kinderly Wade
ID: 40607010
perfect that will do. Thanks Phil
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question