mysql数据库容量及表大小查询语句

来源:互联网 发布:伊舜数码淘宝店怎么样 编辑:程序博客网 时间:2024/05/21 03:56
 查询每个数据库大小
SELECT table_schema AS "Database", 
 ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" 
 FROM information_schema.TABLES 
 GROUP BY table_schema;
 
 
查询表大小
SELECT table_name AS "Table",
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
FROM information_schema.TABLES

查询表
show tables

查询数据库使用存储引擎

show variables like '%storage_engine%';


0 0
原创粉丝点击