mysql数据库统计

 SELECT TABLE_SCHEMA,concat(round((sum(DATA_LENGTH)+sum(INDEX_LENGTH))/1024/1024,2),'MB') as size FROM 
information_schema.TABLES group by TABLE_SCHEMA;


SELECT table_name,table_rows,DATA_LENGTH ,INDEX_LENGTH  
FROM information_schema.TABLES WHERE  TABLE_SCHEMA='dishes' and TABLE_TYPE='BASE TABLE' ORDER BY table_rows DESC; 

你可能感兴趣的:(数据库)