/* 数据库总存储空间 */
select sum(data_length+index_length) size from information_schema.tables;
/* 不同数据库的存储空间 */
select table_schema,sum(data_length+index_length) size from information_schema.tables group by table_schema order by size desc;
/* 指定库下不同表的存储空间 */
select table_name,sum(data_length+index_length) size from information_schema.tables where table_schema='test' group by table_name order by size desc;
阅读(1354) | 评论(0) | 转发(0) |