统计某个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;
标签:index,信息,查询,length,MYSQL,table,data,dbname,schema
From: https://blog.51cto.com/u_15785525/7843480