How to create Relationship between multiple databases? I am working with multiple databases which have the same structure and are on the same server. All of them are MySQL databases and I'm using MySQL Workbench (community version!) to connect to them.

I need to retrieve data from all (or some) of them and compare the results. sometimes I need to store the retrieved data from those databases in another database.

How can I manage that?
Because all databases (schemas) on same server You can operate with data easy - just add schema name before table, like:

SELECT t1.* FROM database1.table1 t1 LEFT JOIN database2.table1 t2 ON t1.id = t2.id


same for compare and save result, like

INSERT INTO database2.table3
SELECT * FROM database1.table1 t1 WHERE NOT EXISTS (SELECT id FROM database2.table1 t2 WHERE t2.id = t1.id)


and etc

MySQL workbench can help You with compare schema

You can also use - mysqldbcompare