Solved

joining two tables from different mysql servers

Posted on 2015-02-10
4
190 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
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Phil Phillips
Comment Utility
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
Comment Utility
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 12

Accepted Solution

by:
Phil Phillips earned 500 total points
Comment Utility
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
Comment Utility
perfect that will do. Thanks Phil
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now