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

mysql 查询库表磁盘占用

时间:2014-07-03 10:35:52      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:strong   for   io   sql   mysql   table   

查整个库的状态:
select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,
          concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,
          concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,
          concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
  from information_schema.tables
where TABLE_SCHEMA = ‘databasename‘;

查单表:
select concat(truncate(sum(data_length)/1024/1024,2),‘MB‘) as data_size,
          concat(truncate(sum(max_data_length)/1024/1024,2),‘MB‘) as max_data_size,
          concat(truncate(sum(data_free)/1024/1024,2),‘MB‘) as data_free,
          concat(truncate(sum(index_length)/1024/1024,2),‘MB‘) as index_size
  from information_schema.tables
where TABLE_NAME = ‘tablename‘;

mysql 查询库表磁盘占用,布布扣,bubuko.com

mysql 查询库表磁盘占用

标签:strong   for   io   sql   mysql   table   

原文地址:http://www.cnblogs.com/hanhongmin/p/3818173.html

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