mysql查看数据库表⼤⼩语句_MySQL查看数据库表容量⼤⼩
的命令语句讲解
MySQL查看数据库表容量⼤⼩的命令语句讲解value在java中的意思
发布时间:2020-04-27 14:17:23
来源:亿速云
直方图怎么手画
美国共和党议员宣布调查拜登阅读:180
作者:三⽉
本⽂主要给⼤家介绍MySQL查看数据库表容量⼤⼩的命令语句讲解,希望可以给⼤家补充和更新些知识,如有其它问题需要了解的可以持续在亿速云⾏业资讯⾥⾯关注我的更新⽂章的。
1.查看所有数据库容量⼤⼩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_sc
hema.tablesgroup by table_schemaorder by sum(data_length) desc, sum(index_length) desc;微服务架构技术栈选型
2.查看所有数据库各表容量⼤⼩select table_schema as '数据库',
mysql语句多表查询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.tablesorder by data_length desc, index_length desc;
3.查看指定数据库容量⼤⼩
例:查看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.tableswhere table_schema='mysql';
4.查看指定数据库各表容量⼤⼩
例:查看mysql库各表容量⼤⼩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.tableswhere table_schema='mysql'order by data_length desc, index_length desc;
本⽂讲解了如何通过MySQL查看数据库表容量⼤⼩,更多相关内容请关注亿速云。相关推荐:
关于php str_getcsv把字符串解析为数组的使⽤⽅法的讲解
优化客户端调⽤服务端接⼝减少请求数据容量文本框怎么设置透明效果
mysql order by rand() 效率优化⽅法

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。