0

Get MySQL database and table size

You can get size of the MySQL databases as following.

SELECT table_schema AS "Database Name", 
   Round(Sum(data_length + index_length) / 1024 / 1024, 1) AS "Size in MB"
FROM   information_schema.tables 
GROUP  BY table_schema;

And get size of tables.

SELECT TABLE_NAME AS "Table Name", 
   table_rows AS "Quant of Rows", 
   ROUND( (data_length + index_length) /1024, 2 ) AS "Size Kb"
FROM   information_schema.TABLES
WHERE   information_schema.TABLES.table_schema = 'DATABASE NAME HERE'