连上数据库

show databases;
+--------------------+
| Database               |
+--------------------+
| information_schema |
| photos                   |
| test                        |
+--------------------+

use information_schema ;

该库存储了所有数据的具体情况。

这条语句就是查询photos数据库中的albums_index_1表的具体数据大小和索引大小。

SELECT concat(round(sum(data_length/1024/1024),2),'MB') as data_length_MB, concat(round(sum(index_length/1024/1024),2),'MB') as index_length_MB  FROM information_schema.TABLES WHERE TABLE_SCHEMA='photos' AND TABLE_NAME='albums_index_1' ;

 

 

备忘。

相关文章:

  • 2021-11-29
  • 2021-11-29
  • 2021-12-13
猜你喜欢
  • 2021-06-24
  • 2021-11-29
  • 2021-10-28
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案