SELECT
table_name AS `Table` ,
round(
(
(data_length + index_length) / 1024 / 1024
) ,
2
) `Size (MB)`
FROM
information_schema. TABLES
WHERE
table_schema = "youDataBase";
查詢表中某一個字段的空間佔用
SELECT sum(char_length($字段名))/1024/1024 as 'M' FROM $yourTable;