码迷,mamicode.com
首页 > 数据库 > 详细

mysql 数据库,表存储 大小

时间:2016-08-30 13:28:30      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

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 数据库,表存储 大小

标签:

原文地址:http://www.cnblogs.com/youlixishi/p/5821609.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!