英国365bet官方网

MySQL——查看数据库大小

发布时间: 2026-07-22 02:05:16 作者: admin 阅读量: 2444 评论数: 521

前言

为了计算一些后面的扩展,所以看下当前业务数据的存储

步骤所有的信息都存放在information_schema这个库里面,我们可以通过查询这个库中的数据来找到我们需要的数据。

查看所有库的数据和索引大小代码语言:javascript复制select table_schema, concat(truncate(sum(data_length)/1024/1024/1024,2),' GB') as data_size,

concat(truncate(sum(index_length)/1024/1024/1024,2),'GB') as index_size

from information_schema.tables

group by table_schema

order by data_length desc;

相关文章