时间:2021-07-01 10:21:17 帮助过:21人阅读
1,查看所有数据库大小
use information_schema;
select concat(round(sum(DATA_LENGTH/1024/1024),2),‘MB‘) as data from TABLES;
2,查看指定数据库大小
use information_schema;
select concat(round(sum(DATA_LENGTH/1024/1024),2),‘MB‘) as data from TABLES where table_schema=‘dbname‘;
3,查看指定数据库中指定表的大小
use information_schema;
select concat(round(sum(data_length/1024/1024),2),‘MB‘) as data from tables where table_schema=‘dbname‘ and table_name=‘tbname‘;
mysql语句技巧
标签:info round mys mysq tab mat ble name select