- 切換到use information_schema
use information_schema;
- 所有數(shù)據(jù)庫的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data_size from tables;
- 指定數(shù)據(jù)庫的大形钪!:
select concat(round(sum(data_length/1024/1024),2),'MB') as data_size from tables where table_schema='my_db1';
- 定數(shù)據(jù)庫的某個表的大小
select concat(round(sum(data_length/1024/1024),2),'MB') as data_size from tables where table_schema='my_db1' and table_name='user_info';