如何查询MySQL数据库的容量?
作者:WeekendLife
时间:2023-04-27
来源:正软商城
浏览:4
mysql查询数据库容量的方法:1、打开DOS窗口,然后进入mysql的bin目录下;2、执行“SELECTtable_schemaAS'shujuku',table_nameAS'biaoming',table_rowsAS'jilushu',TRUNCATE(data_length/1024/1024,2)...”语句即可查看所有数据库各表容量。MySql查看数据库及表容量并排序查看所有数据库容量SELECTtable_schemaAS'数据库&
本文目录
mysql查询数据库容量的方法:1、打开DOS窗口,然后进入mysql的bin目录下;2、执行“SELECT table_schema AS 'shujuku',table_name AS 'biaoming',table_rows AS 'jilushu',TRUNCATE (data_length / 1024 / 1024, 2) ...”语句即可查看所有数据库各表容量。
MySql查看数据库及表容量并排序查看所有数据库容量
SELECT table_schema AS '数据库', sum(table_rows) AS '记录数', sum( TRUNCATE (data_length / 1024 / 1024, 2) ) AS '数据容量(MB)', sum( TRUNCATE (index_length / 1024 / 1024, 2) ) AS '索引容量(MB)' FROM information_schema. TABLES GROUP BY table_schema ORDER BY sum(data_length) DESC, sum(index_length) DESC;
查看所有数据库各表容量
SELECT table_schema AS '数据库', table_name AS '表名', table_rows AS '记录数', TRUNCATE (data_length / 1024 / 1024, 2) AS '数据容量(MB)', TRUNCATE (index_length / 1024 / 1024, 2) AS '索引容量(MB)' FROM information_schema. TABLES ORDER BY data_length DESC, index_length DESC;
查看指定数据库容量
SELECT table_schema AS '数据库', sum(table_rows) AS '记录数', sum( TRUNCATE (data_length / 1024 / 1024, 2) ) AS '数据容量(MB)', sum( TRUNCATE (index_length / 1024 / 1024, 2) ) AS '索引容量(MB)' FROM information_schema.tables where table_schema = 'your_table_name';
查看指定数据库各表容量
SELECT table_schema AS '数据库', table_name AS '表名', table_rows AS '记录数', TRUNCATE ( data_length / 1024 / 1024, 2 ) AS '数据容量(MB)', TRUNCATE ( index_length / 1024 / 1024, 2 ) AS '索引容量(MB)' FROM information_schema.TABLES WHERE table_schema = '指定的库名' ORDER BY data_length DESC, index_length DESC;
作者最新文章
电脑黑屏怎么解决?开机黑屏 只有鼠标等情况排查步骤
2026-11-08 23:28
process lasso怎么关闭开机自动启动
2026-11-01 09:22
红白网站AO3怎么访问?解密使用指南
2026-10-30 11:06
线上PDF转Word怎么操作?如何在线转换PDF为Word?
2026-10-29 15:04
EK by LM TEK 推出 RTX 5070Ti/5080 显卡亚克力水冷头,适配华硕 TUF
2026-10-27 11:04
下一篇:
如何使用Java代码实现酒店管理系统
热门文章
更多
精品专题
更多
Mac软件
更多
火山引擎 网页版
Windows/ macOS/ Linux
火山引擎是字节跳动旗下企业级云与AI服务平台。聚焦大模型核心能力,依托字节自研豆包多模态大模型,凭借火山方舟一站式平台,提供模型精调、推理部署、智能应用搭建等全链路服务,结合高性能AI算力,助力各行业快速落地大模型数字化与智能化应用。
















