查看所有資料庫使用大小 (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 相關文章
使用連線控制插件提高 MySQL 安全性
More...
使用驗證插件提高 MySQL 密碼安全性
More...
用 pv 查看 mysql restore 還原資料進度
More...
使用 sysbench 壓力測試 mysql
More...

作者

留言

撰寫回覆或留言

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