1、进去指定schema 数据库(存放了其他的数据库的信息)
mysql> use information_schema;
2、查询所有数据的大小
mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES;
3、查看指定数据库实例的大小,比如说数据库 yoon
mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='yoon';
4、查看指定数据库的表的大小,比如说数据库 yoon 中的 member 表
mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES
where table_schema='yoon' and table_name='member';
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28939273/viewspace-1061497/
,如需转载,请注明出处,否则将追究法律责任。