Have a look at the INFORMATION_SCHEMA.* views,

e.g.

Code:
select * from information_schema.tables