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 = 'crawl'
2、查询mysql数据库,某个库中某个表的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'scrapy' and table_name='test_score'