1、使用information_schema 数据库。里面存放了其他的数据库的信息 - use information_schema; #一定要先进这个库,才能查询信息
复制代码 2、查询所有数据的大小- select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;
复制代码 3、查看指定数据库test的大小
- select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='test';
复制代码 4、查看test数据库members表的大小- select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='test' and table_name='members';
复制代码
|