1##############################################################
2#Database size in MB
3
4
5SELECT table_schema AS "Database",
6ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)"
7FROM information_schema.TABLES
8GROUP BY table_schema;
9
10##############################################################
11#Table Size in MB per database
12
13SELECT table_name AS "Table",
14ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
15FROM information_schema.TABLES
16WHERE table_schema = "database_name"
17ORDER BY (data_length + index_length) DESC;