mysql sql statement notes finishing

use information_schema;
- Check your current database size
select concat(round(sum(data_length)/(1024*1024),2) + round(sum(index_length)/(1024*1024),2),'MB') as 'DB Size' from tables where table_schema='tspdata';
- view the data space occupied by size
select concat(round(sum(data_length)/(1024*1024),2),'MB') as 'DB Size' from tables where table_schema='tspdata';
- view the index space occupied by size
select concat(round(sum(index_length)/(1024*1024),2),'MB') as 'DB Size'  from tables where table_schema='tspdata';

Guess you like

Origin www.cnblogs.com/tobyzhang/p/11647204.html