<p>一:命令 show table status like 'table_name'\G;</p><pre class="brush:bash;toolbar:false">mysql>showtablestatuslike'x'\G;
***************************1.row***************************
Name:x
Engine:InnoDB
Version:10
Row_format:Compact
Rows:97909
Avg_row_length:37
Data_length:3686400
Max_data_length:0
Index_length:0
Data_free:4194304
Auto_increment:NULL
Create_time:2015-05-1610:41:50
Update_time:NULL
Check_time:NULL
Collation:latin1_swedish_ci
Checksum:NULL
Create_options:
Comment:</pre><p></p><p>其中的data_length 为数据大小;</p><p>二:命令:</p><pre class="brush:bash;toolbar:false">1>useinformation_schema;2>selectdata_length,index_lengthfromtableswheretable_schema='xxxx'andtable_name='xxx';
mysql>useinformation_schema;
Readingtableinformationforcompletionoftableandcolumnnames
Youcanturnoffthisfeaturetogetaquickerstartupwith-A
Databasechanged
mysql>selectdata_length,index_lengthfromtableswheretable_schema='test'\
->andtable_name='x'\G;
***************************1.row***************************
data_length:3686400
index_length:0
1rowinset(0.00sec)</pre><p>MB显示:</p><pre class="brush:bash;toolbar:false">mysql>selectconcat(round(sum(data_length/1024/1024),2),'MB')asdata_length_MB,concat(round(sum(index_length/1024/1024),2),'MB')asindex_length_MB\
->fromtableswheretable_schema='test'andtable_name='x'\G;</pre><p>*************************** 1. row ***************************</p><p>data_length_MB: 3.52MB</p><p>index_length_MB: 0.00MB</p><p>1 row in set (0.04 sec)</p><p>TABLE_SCHEMA : 数据库名</p><p>TABLE_NAME:表名</p><p>ENGINE:所使用的存储引擎</p><p>TABLES_ROWS:记录数</p><p>DATA_LENGTH:数据大小</p><p>INDEX_LENGTH:索引大小</p>