欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql 查询表的行数和空间使用及其它信息_MySQL

程序员文章站 2022-04-18 20:46:16
...
use information_schema;

select concat(round(sum(DATA_LENGTH/1024/1024), 2), 'MB') as data from TABLES;

select concat(round(sum(DATA_LENGTH/1024/1024), 2), 'MB') as data from TABLES where table_schema='dbname';

select table_schema,table_name,table_rows,data_length/1024/1024 from TABLES where table_schema='dbname'

记录