mysql查詢(xún)所有,mysql怎么查看表數(shù)據(jù)量占用空間的sql?
第一步mysql> use information_schema; 第二步mysql> select data_length,index_length -> from tables where -> table_schema='DBNAME' -> and table_name = 'TABLENAME'; 或者mysql> select concat(round(sum(data_length/1024/1024),2),'MB') as data_length_MB, -> concat(round(sum(index_length/1024/1024),2),'MB') as index_length_MB -> from tables where -> table_schema='DBNAME' -> and table_name = 'TABLENAME';