SELECT ROUND( SUM(data_length + index_length) / 1024 / 1024 ) TOTAL_MB, ROUND(SUM(data_length) / 1024 / 1024) DATA_MB, ROUND( SUM(index_length) / 1024 /1024 ) INDEX_MB FROM information_schema.TABLES;
SELECT
TABLE_SCHEMA,
ENGINE,
ROUND(
SUM(data_length + index_length) / 1024 / 1024
) TOTAL_MB,
ROUND(SUM(data_length) / 1024 / 1024) DATA_MB,
ROUND(
SUM(index_length) / 1024 / 1024
) INDEX_MB,
count(*) "TABLES"
FROM
information_schema. TABLES
GROUP BY
TABLE_SCHEMA,
ENGINE
ORDER BY 3 DESC;
Check table number:
SELECT
TABLE_SCHEMA,
ENGINE,
ROUND(
SUM(data_length + index_length) / 1024 / 1024
) TOTAL_MB,
ROUND(SUM(data_length) / 1024 / 1024) DATA_MB,
ROUND(
SUM(index_length) / 1024 / 1024
) INDEX_MB,
count(*) "TABLES"
FROM
information_schema. TABLES
GROUP BY
TABLE_SCHEMA,
ENGINE
ORDER BY 3 DESC;