mysql数据库容量查询
1、統(tǒng)計每張表的數(shù)據(jù)量
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、統(tǒng)計每張表的數(shù)據(jù)容量(數(shù)據(jù)量+索引)
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、查看數(shù)據(jù)庫數(shù)據(jù)量
SELECT concat(round(sum(DATA_LENGTH / 1024 / 1024 / 1024), 2), 'G')
FROM information_schema. tables
WHERE table_schema= 'platform_all_edu' ;
轉(zhuǎn)載于:https://www.cnblogs.com/invban/p/5751923.html
總結(jié)
以上是生活随笔為你收集整理的mysql数据库容量查询的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dojo gridx修改表头
- 下一篇: 内容营销的21条黄金法则