-
查询某个数据库,指定数据库名:打开
information_schema,在它之下查询select concat(round(sum(data_length/1024/1024),2),'MB') as data from tables where table_schema='XXX'; -
cmd下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:将字节转换为MBround(sum(data_length/1024/1024),2):取两位小数concat(round(sum(data_length/1024/1024),2),'MB') :给计算结果追加单位 “MB”
相关文章: