查看所有資料庫使用大小 (MB)
SELECT table_schema "database", sum(data_length + index_length)/1024/1024 "size in MB" FROM information_schema.TABLES GROUP BY table_schema;
查看某某資料庫使用大小
SELECT table_schema "database", sum(data_length + index_length)/1024/1024 "size in MB" FROM information_schema.TABLES WHERE table_schema='資料庫名稱' GROUP BY table_schema;
查看某某資料庫的資料表使用大小
SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "資料庫名稱" ORDER BY (data_length + index_length) DESC;
留言