mysql 查看库表数量,库空间大小

select 
  count(TABLE_NAME),

  concat(truncate(data_length/1024/1024,2),' MB') as data_size,
  concat(truncate(index_length/1024/1024,2),' MB') as index_size
from information_schema.tables where TABLE_SCHEMA = 'TestDB'
posted @ 2022-06-10 14:53  微风微风  阅读(52)  评论(0编辑  收藏  举报