I'm going to forget this, so blogging it for the future.
SELECT
table_schema AS 'Database',
ROUND(SUM(data_length) / 1024 / 1024, 2) AS 'Data',
ROUND(SUM(index_length) / 1024 / 1024, 2) AS 'Indexes',
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'Total'
FROM
information_schema.TABLES
GROUP BY table_schema;
- Log in to post comments