进入终端
mysql -uroot -p
show databases;
use information_schema;
1.查看数据库总大小
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from tables;
2.查询某个数据库的大小
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from tables where TABLE_SCHEMA='wordpress';
3.查询某个数据库下某个表的大小
select concat(round(DATA_LENGTH/1024/1024,2),'MB') as data from tables where TABLE_SCHEMA='wordpress' and TABLE_NAME='wp_options';
已有 0 条评论