You can create cross-databases, no problem. Just a prefix to the name of your table with the database name.
SELECT t1.id, t1.name, t2.id, t2.telephone
FROM db1.table1 t1
INNER JOIN db2.table2 t2 on t1.id = t2.id;
Be careful with permissions. If the user does not have access to one of the databases, this selection will not be made.
source
share