Solved

joining two tables from different mysql servers

Posted on 2015-02-10
4
193 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
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 12

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

26 Experts available now in Live!

Get 1:1 Help Now