use information_schema;
方法1:select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='数据库名';
方法2:select concat(round(sum(data_length/1024/1024),2)+round(sum(index_length/1024/1024),2),'MB') as data from tables where table_schema='数据库名';