mysql 查看数据库大小

时间:2021-12-04 23:34:24
use information_schema;
查看所有
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables;
查看指定数据库
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='hivedb';
查看指定表
select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='busdata' and table_name='syslog';