purazumakoiの[はてなブログ]

技術メモから最近はライフログも増えてきてます。

DB容量の取得

show table status


DBごとにMB単位で表示

select table_schema, sum(data_length+index_length) /1024 /1024 as MB from information_schema.tables group by table_schema order by sum(data_length+index_length) desc


テーブルごと

show table status from DB名 like 'テーブル名';