Name

SHOW

Synopsis

SHOW DATABASES [LIKE clause]
SHOW KEYS FROM table [FROM database]
SHOW INDEX FROM table [FROM database]
SHOW TABLES [FROM database] [LIKE clause]
SHOW COLUMNS FROM table [FROM database] [LIKE clause]
SHOW FIELDS FROM table [FROM database] [LIKE clause]
SHOW STATUS
SHOW TABLE STATUS [FROM database] [LIKE clause]
SHOW VARIABLES [LIKE clause]

Displays various information about the MySQL system. This statement can be used to examine the status or structure of almost any part of MySQL.

Examples

# Show the available databases
SHOW DATABASES
# Display information on the indexes on table 'bigdata'
SHOW KEYS FROM bigdata
# Display information on the indexes on table 'bigdata' in the database 'mydata'
SHOW INDEX FROM bigdata FROM mydata
# Show the tables available from the database 'mydata' that begin with the
# letter 'z'
SHOW TABLES FROM mydata LIKE 'z%'
# Display information about the columns on the table 'skates'
SHOW COLUMNS FROM stakes
# Display information about the columns on the table 'people' that end with
# '_name'
SHOW FIELDS FROM people LIKE '%\_name'
# Show server status information.
SHOW STATUS
# Display server variables
SHOW VARIABLES

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.