mysql 查看表数据大小
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES
2、查询mysql数据库,某个库
1、查询整个mysql数据库,整个库的大小;单位转换为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 = 'testdb' 3、查看库中某个表的大小; select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb' and table_name = 'test_a'; 4、查看mysql库中,test开头的表mysql数据表,所有存储大小; select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb' and table_name like 'test%'; (编辑:徐州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |