• 查询某个数据库,指定数据库名:打开information_schema,在它之下查询
    select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='XXX';
    mysql 查询数据库内存大小

  • cmd下mysql语句
    mysql 查询数据库内存大小

  • 查看指定数据库的某个表的大小:比如查看数据库home中 members 表的大小
    select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='home' and table_name='members';

  • 备注 :

    data_length :存储数据大小
    data_length/1024/1024:将字节转换为MB
    round(sum(data_length/1024/1024),2):取两位小数
    concat(round(sum(data_length/1024/1024),2),'MB') :给计算结果追加单位 “MB”

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2021-11-13
  • 2021-11-29
  • 2021-12-23
  • 2021-11-29
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2021-11-29
  • 2021-11-29
  • 2021-11-30
  • 2021-10-03
  • 2022-12-23
相关资源
相似解决方案