How can I select data from two differents servers? I have two databases: data1 and data2 in two different servers (server1 and server2).

I am trying to join two tables of my two databases in MySQL like this: 

SELECT left(a.code,9) as fourn,
       SUM(b.price) as total
FROM data1.product as a
JOIN data2.my_items as b ON a.fourn = b.left(p_code)


and this is the error I get when I run the query in server1: 


  SELECT command denied to user 'slave'@'' for table 'my_items'
Federated storage engine can help you.

In mysql, you can achieve this by using federated storage engine. It allows you to access tables from different server. Once you reference the table from specific server, you can use it. You can get more details about 
federated storage engine. Now you can join two tables from different servers. how to use federated engine 

ETL tools can help you like Talend data integration

Talend is open source tool which is ETL tool uses in data ware housing. It have nice UI, you can learn it in short duration. Here you can create many Mysql or database connections  and use the different connections for different tables, can join whatever as you need.