You can create a view of all possible tables:
create v_tables as select 'table1' as which, t.* from table1 t union all select 'table2' as which, t.* from table2 t . . .;
Then, you can select from the view.
In MySQL this is not particularly efficient, because all the tables will still need to be read. However, for smaller tables this could be a reasonable solution.
You should ask yourself why you have identically structured tables in the databases. In general, these should be combined into a single table. For performance, you can partition the table.