within MySQL, providing both databases are on the same physical server you can directly address tables in another db and treat them as local tables
so anything that you can do in SQL can be done on tables in different MySQL databases THAT are on the same server.
to do this use the database name as part of the table/column defintion
eg
select my, column, list FROM MyTable as A
join SecondDataBase.MyOtherTable as B on B.MyColumn = A.MyColumn
select A.my, B.column, A.list FROM MyTable as A
join SecondDataBase.MyOtherTable as B on B.MyColumn = A.MyColumn
But then had you done a
google search you'd have known that
Connecting two mysql tables from different databases - PHP