To List all databases with its size in MB or GB, below command can be used to get the information.
Below is the command to list all databases with its size in MB.
SELECT table_schema AS “Database name”, SUM(data_length + index_length) / 1024 / 1024 AS “Size (MB)” FROM information_schema.TABLES GROUP BY table_schema;
Below is the command to list all database with its size in GB.
SELECT table_schema “database”, sum(data_length + index_length)/1024/1024/1024 “size in GB” FROM information_schema.TABLES GROUP BY table_schema;