统计Mysql数据占用空间大小
原创
52cxy
10-26 21:55
阅读数:309
此SQL可以统计数据库占用空间大小,包含数据占用区间、索引占用空间、碎片占用空间:
select sum(data_free)/1024/1024/1024,sum(data_length)/1024/1024/1024,sum(index_length)/1024/1024/1024 from information_schema.tables where table_schema not in ('information_schema', 'mysql')
再加上日志占用空间,即为整个存储空间总大小。
共0条评论