MySQL统计数据库表大小

use information_schema;  
SELECT   
   TABLE_NAME,  
    (DATA_LENGTH/1024/1024) as DataM ,  
    (INDEX_LENGTH/1024/1024) as IndexM,   
    ((DATA_LENGTH+INDEX_LENGTH)/1024/1024) as AllM,  
    TABLE_ROWS  
FROM  
    TABLES  
WHERE  
    TABLE_SCHEMA = 'dbname' order by DataM desc;

 

转载于:https://www.cnblogs.com/lixx/p/8253148.html

你可能感兴趣的:(MySQL统计数据库表大小)