SELECT
TABLE_NAME,
DATA_LENGTH,
INDEX_LENGTH,
( DATA_LENGTH + INDEX_LENGTH ) AS length,
TABLE_ROWS,
concat( round( ( DATA_LENGTH + INDEX_LENGTH ) / 1024 / 1024, 3 ), 'MB' ) AS total_size
FROM
information_schema.TABLES
WHERE
TABLE_SCHEMA = 'databasename'
ORDER BY
length DESC;
查数据库的每个表数据大小
最新推荐文章于 2023-03-23 14:21:19 发布