2021-09-21 MySQL 库、表大小查看

当前库最大包大小M

select CONCAT(@@max_allowed_packet/1024/1024, 'M');

在这里插入图片描述

某表的大小M

select concat(round(sum(DATA_LENGTH/1024/1024),2),'M') as '表数据大小',concat(round(sum(INDEX_LENGTH/1024/1024),2),'M') as '表索引大小'
from tables where table_schema='db_name' AND table_name='table_name'; 

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_36434219/article/details/120405176