0
点赞
收藏
分享

微信扫一扫

MYSQL表信息查询

MYSQL表信息查询_占用空间

统计某个DB里的表占用空间和行数

dbname参数请用实际数据库名替换。

SELECT table_name AS `Table`, 
ROUND(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`,
TABLE_ROWS FROM information_schema.tables 
WHERE table_schema = "dbname"
# AND table_name like '%test%'
ORDER BY (data_length + index_length) DESC;

举报

相关推荐

0 条评论