MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 4612|回复: 2
打印 上一主题 下一主题

如何统计mysql某数据库实例下的表数据大小

[复制链接]
1#
发表于 2014-9-16 09:33:43 | 显示全部楼层
mysql> show table status like 'actor'\G
*************************** 1. row ***************************
           Name: actor
         Engine: InnoDB
        Version: 10
     Row_format: Compact
           Rows: 200
Avg_row_length: 81
    Data_length: 16384
Max_data_length: 0
   Index_length: 16384
      Data_free: 0
Auto_increment: 201
    Create_time: 2014-08-20 18:24:49
    Update_time: NULL
     Check_time: NULL
      Collation: utf8_general_ci
       Checksum: NULL
Create_options:
        Comment:
1 row in set (0.22 sec)

或者

use information_schema;

查看指定数据库的表的大小,比如说数据库 yoon 中的 yoon 表
     mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES
                 where table_schema='yoon' and table_name='yoon';
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-5-20 08:17 , Processed in 0.064616 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表