SELECT TABLE_NAME FROM information_schema.`TABLES` T where TABLE_SCHEMA='tidemedia_vms' order by DATA_LENGTH desc;
use information_schema;
查询数据库“tidemedia_cms”中publish_task 的表
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='tidemedia_cms' and table_name='publish_task';
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='uchome' and table_name='uchome _log';
1、进去指定schema 数据库(存放了其他的数据库的信息)
1 | mysql> use information_schema; |
2、查询所有数据的大小
1 | mysql> select concat(round( sum (DATA_LENGTH/1024/1024), 2), 'MB' ) |
2 | -> as data from TABLES; |
8 | 1 row in set (16.81 sec) |
3、查看指定数据库实例的大小,比如说数据库 forexpert
1 | mysql> select concat(round( sum (DATA_LENGTH/1024/1024), 2), 'MB' ) |
2 | -> as data from TABLES where table_schema= 'forexpert' ; |
8 | 1 row in set (7.47 sec) |
4、查看指定数据库的表的大小,比如说数据库 forexpert 中的 member 表
1 | mysql> select concat(round( sum (DATA_LENGTH/1024/1024),2), 'MB' ) as data |
2 | -> from TABLES where table_schema= 'forexpert' |
3 | -> and table_name= 'member' ; |
9 | 1 row in set (1.88 sec) |