MySQL Information Schema  /  The INFORMATION_SCHEMA SCHEMATA Table

Chapter 2 The INFORMATION_SCHEMA SCHEMATA Table

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

The SCHEMATA table has these columns:

  • CATALOG_NAME

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

  • 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 always NULL.

Schema names are also available from the SHOW DATABASES statement. See SHOW DATABASES Syntax. The following statements are equivalent:

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

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.