当前位置:   article > 正文

查mysql剩余磁盘空间命令_MySQL查看库所占磁盘空间大小的命令、查看表所占磁盘空间大小的命令...

c# 获取mysql数据库所在硬盘剩余存储

查看库所占磁盘空间大小的命令:

SELECT CONCAT(TRUNCATE(SUM(data_length)/1024/1024,2),’MB’) AS data_size,

CONCAT(TRUNCATE(SUM(max_data_length)/1024/1024,2),’MB’) AS max_data_size,

CONCAT(TRUNCATE(SUM(data_free)/1024/1024,2),’MB’) AS data_free,

CONCAT(TRUNCATE(SUM(index_length)/1024/1024,2),’MB’) AS index_size

FROM information_schema.tables WHERE TABLE_SCHEMA = ‘数据库名’;

查看表所占磁盘空间大小的命令

SELECT CONCAT(TRUNCATE(SUM(data_length)/1024/1024,2),’MB’) AS data_size,

CONCAT(TRUNCATE(SUM(max_data_length)/1024/1024,2),’MB’) AS max_data_size,

CONCAT(TRUNCATE(SUM(data_free)/1024/1024,2),’MB’) AS data_free,

CONCAT(TRUNCATE(SUM(index_length)/1024/1024,2),’MB’) AS index_size

FROM information_schema.tables WHERE TABLE_NAME = ‘表名’;

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号