EN
MySQL - how to check database size?
17 points
Using MySQL querry it is possible to check database size in following way.
xxxxxxxxxx
1
SELECT
2
`table_schema` AS 'database_name',
3
SUM(data_length + index_length) AS 'database_size'
4
FROM `information_schema`.`tables `
5
GROUP BY `table_schema`;
Result:

xxxxxxxxxx
1
SELECT
2
`table_schema` AS 'database_name',
3
ROUND(SUM(data_length + index_length) / 1024, 2) AS 'database_size'
4
FROM `information_schema`.`tables`
5
GROUP BY `table_schema`;
Result:

xxxxxxxxxx
1
SELECT
2
`table_schema` AS 'database_name',
3
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'database_size'
4
FROM `information_schema`.`tables`
5
GROUP BY `table_schema`;
Result:
