use information_schema;

-- 查询一个数据库存储大小

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database nane'; 85MB

-- 查询一个表存储大小

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database nane' and table_name='saleorder'; 0.23MB/505

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database nane' and table_name='productset'; 0.08MB/134

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database nane' and table_name='product'; 0.19MB/487

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database nane' and table_name='productattribute'; 0.11MB/711

select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='database nane' and table_name='userpictures'; 0.02MB/30

相关文章:

  • 2022-02-03
  • 2021-11-29
  • 2021-08-02
  • 2021-11-13
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2021-09-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-11-29
  • 2021-09-10
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案