ITeye博客

查看数据表大小

ww111 · 2013-07-06 12:50 · linux mysql · 数据库 · Markdown

// 表
select TABLE_NAME AS '表名',DATA_LENGTH/1024/1024 AS '数据大小(M)', INDEX_LENGTH/1024/1024 AS '索引大小(M)',TABLE_ROWS/10000 AS '数据量(万)'  from information_schema.TABLES where information_schema.TABLES.TABLE_SCHEMA = 'duobaohui' and information_schema.TABLES.TABLE_NAME = 'comment'\G;

// 数据库
select concat(round(sum(data_length/1024/1024),2),'MB') as '数据库大小' from tables where table_schema='duobaohui';

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。