SHOW DATABASES returns the names of all databases the current user can access.
SHOW DATABASES lists every database the connected user has permission to see, making it the quickest way to discover existing schemas before running queries.
Run the simple statement SHOW DATABASES; in any SQL client or in Galaxy’s editor. The server returns one row per database.
Add a LIKE or WHERE clause: SHOW DATABASES LIKE 'shop%'; limits the result set to names that begin with shop
.
MariaDB doesn’t support ORDER BY inside SHOW DATABASES. Copy the result into a subquery when ordering is required: SELECT * FROM (SHOW DATABASES) AS t ORDER BY Database;
If your workspace contains customers
, orders
, and products
databases, filter with LIKE: SHOW DATABASES LIKE '%orders%' OR LIKE '%products%';
You need the SHOW DATABASES privilege or any privilege on a database to see its name. DBAs can grant SHOW DATABASES ON *.* TO 'analyst'@'%';
Use INFORMATION_SCHEMA.SCHEMATA when you need additional metadata such as default character set or collation. SELECT SCHEMA_NAME, DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA;
Prefix SHOW DATABASES with \\G in the MariaDB CLI to display each name on its own line. Avoid hard-coding database names—use SHOW DATABASES programmatically in admin scripts.
Yes. MariaDB treats DATABASES and SCHEMAS as synonyms.
Yes, you’ll see information_schema, mysql, and performance_schema unless your privileges hide them.
Query INFORMATION_SCHEMA.SCHEMATA joined with TABLES: SELECT s.SCHEMA_NAME, SUM(t.DATA_LENGTH+t.INDEX_LENGTH) AS size_bytes FROM INFORMATION_SCHEMA.SCHEMATA s JOIN INFORMATION_SCHEMA.TABLES t ON s.SCHEMA_NAME=t.TABLE_SCHEMA GROUP BY 1;