mysql数据库容量查询
1、統計每張表的數據量
SELECT
*
FROM
(
select
TABLE_NAME,
concat(
round(
sum(DATA_LENGTH / 1024 / 1024 ),
7
)
) as size
from
information_schema. tables
where
table_schema = 'platform_all_edu'
GROUP BY
table_name
) t;
2、統計每張表的數據容量(數據量+索引)
select
table_name,
(
sum(DATA_LENGTH) + sum(INDEX_LENGTH)
) / 1024 / 1024 as size
from
information_schema. tables
where
table_schema = 'platform_all_edu'
GROUP BY
table_name;
3、查看數據庫數據量
SELECT concat(round(sum(DATA_LENGTH / 1024 / 1024 / 1024), 2), 'G')
FROM information_schema. tables
WHERE table_schema= 'platform_all_edu' ;
轉載于:https://www.cnblogs.com/invban/p/5751923.html
總結
以上是生活随笔為你收集整理的mysql数据库容量查询的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dojo gridx修改表头
- 下一篇: 内容营销的21条黄金法则