当前第2页 返回上一页
1 2 3 4 5 6 7 | 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= 'mysql' ;
|
4.查看指定数据库各表容量大小
例:查看mysql库各表容量大小
1 2 3 4 5 6 7 8 9 | 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= 'mysql'
order by data_length desc, index_length desc;
|
相关学习推荐:mysql教程
以上就是mysql 如何查看表的大小的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
如何在服务器安装mysql
mysql增加外键有哪些方法
我所理解的mysql之二:索引
mysql配置文件my.cnf优化详解(mysql5.5)
mysql日期格式转换函数有哪些
mysql如何创建多个联合索引
通过两种方式增加从库——不停止mysql服务
redhat6.5怎么安装mysql?
百万数据下mysql条件查询及分页查询的注意事项
怎么查看自己的mysql密码
更多相关阅读请进入《mysql》频道 >>
机械工业出版社
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。
转载请注明出处:木庄网络博客 » mysql 如何查看表的大小