MySQL显示数据库大小

示例代码即查看了home库的大小,其他的举一反三。

use information_schema;
//查看数据库home的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home';
//查看数据库home中 members 表的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';

 

未经允许不得转载:阿藏博客 » MySQL显示数据库大小

赞 (0) 打赏