Documentation Home
MySQL 9.1 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.4Mb
PDF (A4) - 40.5Mb
Man Pages (TGZ) - 259.5Kb
Man Pages (Zip) - 366.7Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


MySQL 9.1 Reference Manual  / ...  / INFORMATION_SCHEMA Tables  / INFORMATION_SCHEMA General Tables  /  The INFORMATION_SCHEMA SCHEMATA Table

28.3.31 The INFORMATION_SCHEMA SCHEMATA Table

A schema is a database, so theSCHEMATA table provides information about databases.

TheSCHEMATA table has these columns:

  • CATALOG_NAME

    The name of the catalog to which the schema belongs. This value is alwaysdef.

  • SCHEMA_NAME

    The name of the schema.

  • DEFAULT_CHARACTER_SET_NAME

    The schema default character set.

  • DEFAULT_COLLATION_NAME

    The schema default collation.

  • SQL_PATH

    This value is alwaysNULL.

  • DEFAULT_ENCRYPTION

    The schema default encryption.

Schema names are also available from theSHOW DATABASES statement. SeeSection 15.7.7.15, “SHOW DATABASES Statement”. The following statements are equivalent:

SELECT SCHEMA_NAME AS `Database`  FROM INFORMATION_SCHEMA.SCHEMATA  [WHERE SCHEMA_NAME LIKE 'wild']SHOW DATABASES  [LIKE 'wild']

You see only those databases for which you have some kind of privilege, unless you have the globalSHOW DATABASES privilege.

Caution

Because any static global privilege is considered a privilege for all databases, any static global privilege enables a user to see all database names withSHOW DATABASES or by examining theSCHEMATA table ofINFORMATION_SCHEMA, except databases that have been restricted at the database level by partial revokes.

Notes