相關學習推薦:mysql數據庫
mysql查詢數據庫的大小的方法:
1、查詢整個mysql數據庫,整個庫的大小;單位轉換為MB。
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES
2、查詢mysql數據庫,某個庫的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb'
3、查看庫中某個表的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb' and table_name = 'test_a';
4、查看mysql庫中,test開頭的表,所有存儲大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb' and table_name like 'test%';
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com