查看Mysql某個數據庫的每張表的大小

把test換成你自己使用的數據庫名稱即可

select table_name, concat(truncate(data_length/1024/1024,2),' mb') as data_size,
concat(truncate(index_length/1024/1024,2),' mb') as index_size
from information_schema.tables where table_schema = 'test'
group by table_name
order by data_length desc;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章