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;
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: mysql