08/29: MySQL > Obtaining Database Metadata
Category: Study
Posted by: hajime osako
The INFORMATION_SCHEMA database has a SCHEMATA table that contains database metadata.
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'searching database';
The output of the SHOW DATABASES statement depends on whether you have the SHOW DATABASES privilege. It can take a LIKE clause.
SHOW DATABASES LIKE 'm%';
SHOW CREATE DATABASE shows the CREATE DATABASE statement.
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'searching database';
The output of the SHOW DATABASES statement depends on whether you have the SHOW DATABASES privilege. It can take a LIKE clause.
SHOW DATABASES LIKE 'm%';
SHOW CREATE DATABASE shows the CREATE DATABASE statement.