查看所有資料庫使用大小 (MB)

SELECT table_schema "database", sum(data_length + index_length)/1024/1024 "size in MB" FROM information_schema.TABLES GROUP BY table_schema;

查看某某資料庫使用大小

SELECT table_schema "database", sum(data_length + index_length)/1024/1024 "size in MB" FROM information_schema.TABLES WHERE table_schema='資料庫名稱' GROUP BY table_schema;

查看某某資料庫的資料表使用大小

SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "資料庫名稱" ORDER BY (data_length + index_length) DESC;

 

Related posts 相關文章
使用 sysbench 壓力測試 mysql
More...
Percona XtraDB Cluster 是 MySQL 的叢集與分散式解決方案
More...
基本 MySQL 安全性設置
More...
MySQL 8.0
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。