List schemas in MySQL database

The query below lists databases (schemas) on MySQL instance.


A. Generic query

select schema_name as database_name
from information_schema.schemata
order by schema_name;

B. Show statement (option 1)

show databases;

C. Show statement (option 2)

show schemas;


  • schema_name - database (schema) name


  • One row: represents one database (schema)
  • Scope of rows: all databases (schemas) on MySQL instance
  • Ordered by: database (schema) name

Sample results

Below is the sample results generated by Generic query (option A).

View of databases (schemas) in MySQL Workbench. Blue rectangle selects system databases (schemas).

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
There are no comments. Click here to write the first comment.