zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

mysql 查看某数据库各个表容量大小

mysql数据库 查看 大小 容量 各个
2023-09-27 14:24:44 时间
SELECT
    table_schema AS '数据库',
    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 = 'test' -- 数据库名字
ORDER BY
    table_rows DESC;