The ANSI standard makes it fairly straight forward to retrieve metadata from a database server through the use of the INFORMATION_SCHEMA. For further convienience MySQL uses the SHOW syntax. SHOW TABLES, SHOW DATABASES, etc.
CREATED2012-11-22 11:46:11.0
00-18-2F
UPDATED2012-11-22 11:46:31.0
Displaying Databases...
SHOW DATABASES returns a list of the databases withing the current server instance.
mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | kennyl | | mysql | | performance_schema | | tomcatusers | | wordpress | +--------------------+ 6 rows in set (0.00 sec)
CREATED2012-11-21 21:42:29.0
00-18-1F
UPDATED2012-11-22 11:46:15.0
Displaying Tables...
SHOW TABLES; shows all the tables in the selected database.
The result has been truncated, the list also includes Security_type, Comment, character_set_client, collation_connection and Database_collation. I think the main interest is in Db, Name and type.
CREATED2012-11-22 11:34:53.0
00-18-2D
UPDATED2012-11-22 11:43:10.0
Displaying Functions...
SHOW FUNCTION STATUS;
SHOW FUNCTION STATUS displays a list of functions that have been stored on the selected database.