查看數(shù)據(jù)庫(kù)的某個(gè)表的大小
SELECT table_name AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "<DB>"
ORDER BY (data_length + index_length) DESC;
查看數(shù)據(jù)庫(kù)的大小
select round(sum(data_length/1024/1024),2) 'Data Size in MB',
round(sum(index_length/1024/1024),2) 'Index Size in MB',
round(sum((index_length + data_length)/1024/1024),2) 'All Size in MB'
FROM information_schema.TABLES where table_schema='<DB>';
把 <DB>
替換成需要查詢的數(shù)據(jù)庫(kù)名, 只在 Mysql / MariaDB運(yùn)行過.