首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

mysql查看数据库大小,目录大小

2012-08-22 
mysql查看数据库大小,索引大小select concat(round(sum(index_LENGTH)/(1024*1024),2),MB) as Index Si

mysql查看数据库大小,索引大小
select concat(round(sum(index_LENGTH)/(1024*1024),2),'MB') as 'Index Size' from tables where table_schema='usertest';

mysql> use information_schemaDatabase changedmysql> select concat(round(sum(index_LENGTH)/(1024*1024),2),'MB') as 'Index Size' from tables where table_schema='bbs'; +-----------+| Index Size |+-----------+| 0.00MB    | +-----------+1 row in set (0.01 sec)解释:concat和“MB”是单位round和2表明精确2位小数sum表明所有的索引相加table_schema='bbs' bbs就是你要统计的数据库mysql> select concat(round(sum(data_LENGTH)/(1024*1024),2),'MB') as 'Data Size' from tables where table_schema='bbs'; +-----------+| Data Size |+-----------+| 4.34MB    | +-----------+1 row in set (0.01 sec)

热点排行