相關(guān)學(xué)習(xí)推薦:mysql數(shù)據(jù)庫(kù)
mysql查詢數(shù)據(jù)庫(kù)的大小的方法:
1、查詢整個(gè)mysql數(shù)據(jù)庫(kù),整個(gè)庫(kù)的大小;單位轉(zhuǎn)換為MB。
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES
2、查詢mysql數(shù)據(jù)庫(kù),某個(gè)庫(kù)的大小;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from information_schema.TABLES where table_schema = 'testdb'
3、查看庫(kù)中某個(gè)表的大小;
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庫(kù)中,test開頭的表,所有存儲(chǔ)大小;
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%';
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com