mysqlデータベースサイズ、インデックスサイズの表示
925 ワード
select concat(round(sum(index_LENGTH)/(1024*1024),2),'MB') as 'Index Size' from tables where table_schema='usertest';
mysql> use information_schema
Database changed
mysql> 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)