查询数据库大小
时间: 2019-03-28来源:OSCHINA
前景提要
要想知道每个数据库的大小的话,步骤如下:
1、show DATABASES;
2、进入information_schema 数据库(存放了其他的数据库的信息)
use information_schema;

3、查询所有数据的大小:
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;

4、查看指定数据库的大小:
比如查看数据库home的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home';

5、查看指定数据库的某个表的大小
比如查看数据库home中 members 表的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行