– 1. 查询所有数据总的磁盘使用量:
select concat(round(sum(data_length/1024/1024),2),'MB') as data
from information_schema.tables;
– 2. 查看所有数据库实例的磁盘占用情况
select table_schema ,concat(round(sum(data_length/1024/1024),2),'MB') as data from information_schema.tables group by table_schema;
– 4.查看指定数据库的大小,例如数据库zabbix:
select concat(round(sum(data_length/1024/1024),2),'MB') as data
from information_schema.tables
where table_schema='zabbix';