mysql 数据库,表存储 大小

Posted youlixishi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 数据库,表存储 大小相关的知识,希望对你有一定的参考价值。

use information_schema;

-- 查询一个数据库存储大小

select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘database nane‘; 85MB

-- 查询一个表存储大小

select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘database nane‘ and table_name=‘saleorder‘; 0.23MB/505

select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘database nane‘ and table_name=‘productset‘; 0.08MB/134

select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘database nane‘ and table_name=‘product‘; 0.19MB/487

select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘database nane‘ and table_name=‘productattribute‘; 0.11MB/711

select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘database nane‘ and table_name=‘userpictures‘; 0.02MB/30

以上是关于mysql 数据库,表存储 大小的主要内容,如果未能解决你的问题,请参考以下文章