如何查询MySQL数据库的容量?
作者:WeekendLife
时间:2023-04-25
浏览:1
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;
作者最新文章
parallels desktop内存分配怎么更改
2026-10-09 15:31
photoshop钢笔工具抠图怎么用
2026-10-06 12:02
打印机暂停打印的解决方法及恢复正常打印步骤
2026-09-22 14:32
华强北手机全线涨价:涨幅400-1500元,存储成本推高售价
2026-09-08 19:22
PDF转XML操作步骤与在线工具使用指南
2026-09-03 10:06
下一篇:
如何使用Java代码实现酒店管理系统
热门文章
更多
精品专题
更多
Mac软件
更多
WINDOWS
更多

































