天天看點

Mysql 查詢資料庫資料量

Mysql查詢資料庫資料量

SELECT
    table_name AS '表名',
    table_rows AS '記錄數',
    TRUNCATE (data_length / 1024 / 1024, 2) AS '資料容量(MB)',
    TRUNCATE (index_length / 1024 / 1024, 2) AS '索引容量(MB)'
FROM
    information_schema. TABLES
WHERE
    table_schema = 'ei_qs_study'
ORDER BY
    table_rows DESC;