1 2 3 4 5 6 7 8 9
| select table_schema as 'database', table_name as 'table_name', table_rows as 'records', truncate(data_length/1024/1024, 2) as 'dataLength(MB)', truncate(index_length/1024/1024, 2) as 'indexLength(MB)' from information_schema.tables where table_schema='mysql' order by data_length desc, index_length desc;
|