MYSQL 数据库存储空间大小查询
1、查询整个mysql数据库,整个库的大小;e79fa5e98193e78988e69d8331333431376638单位转换为MB。
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES
2、查询mysql数据库,某个库的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'smart_vue'
3、查询mysql数据库,某个库中某个表的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'smart_vue' and table_name='sys_user'