E-mail:vova@vbeg.ru
Skype:vova-beglecov

Getting sizes of all tables in MySQL

The query to get size of all tables in MySQL:

SELECT
    table_name AS table_name,
    engine,
    ROUND(data_length/1024/1024,2) AS total_size_mb,
    table_rows
FROM
    information_schema.tables
WHERE
    table_schema=DATABASE();


Query result: