Name

SHOW DATABASES

Synopsis

SHOW DATABASES [LIKE 'pattern']

This statement displays a list of databases for the server. Using the LIKE clause, a naming pattern may be given. For example, suppose that a server has a separate database for each customer of the organization and that the pattern for the names of the databases is cust_number, where the number is the customer account number. You could enter the following SQL statement to obtain a list of databases based on this pattern:

SHOW DATABASES LIKE 'cust_%';

Get MySQL in a Nutshell 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.