1.首先进入information_schema 数据库(存放了其他的数据库的信息)
mysql> use information_schema; Database changed
(1)查看所有数据库大小
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES;
(2)查看指定数据库大小
1 mysql> select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='CarData';