The following query can show the size (GB) of all the database in a table view :
SELECT table_schema "database", sum(data_length + index_length)/1024/1024/1024 "size in GB"
FROM information_schema.TABLES GROUP BY table_schema;
The following query can show the size (MB) of all the database in a table view :
SELECT table_schema 'database', ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
The following query can show only the size of a specific database:
SELECT table_schema,
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables WHERE table_schema='DB_NAME'
GROUP BY table_schema ;
The following query can show total tables, the total table row, DB size of a specific database:
SELECT TABLE_SCHEMA AS DB_Name, count(TABLE_SCHEMA) AS Total_Tables,
SUM(TABLE_ROWS) AS Total_Tables_Row,
ROUND(sum(data_length + index_length)/1024/1024) AS "DB Size (MB)", ROUND(sum( data_free )/ 1024 / 1024) AS "Free Space (MB)"
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'DB_NAME'
GROUP BY TABLE_SCHEMA ;