统计每个数据库的大小
select table_schema,sum(data_length)/1024/1024/1024 "data_length(GB)",sum(index_length)/1024/1024/1024 "index_length(GB)",sum(data_length+index_length)/1024/1024/1024 "total_size(GB)"
from information_schema.tables
where table_schema!='information_schema'
and table_schema!='mysql'
group by table_schema;
+--------------------+-----------------+------------------+----------------+
| table_schema | data_length(GB) | index_length(GB) | total_size(GB) |
+--------------------+-----------------+------------------+----------------+
| lei | 0.008316040039 | 0.004409790039 | 0.012725830078 |
| performance_schema | 0.000000000000 | 0.000000000000 | 0.000000000000 |
| ray | 0.008316040039 | 0.004409790039 | 0.012725830078 |
| sys | 0.000015258789 | 0.000000000000 | 0.000015258789 |
+--------------------+-----------------+------------------+----------------+
4 rows in set (0.03 sec)