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='数据库名';
本文介绍两种使用SQL查询特定数据库总大小的方法,包括数据和索引占用的空间。
202

被折叠的 条评论
为什么被折叠?



