mysql查詢數(shù)據(jù)庫的大小

mysql查詢數(shù)據(jù)庫的大小的方法:1、查詢整個庫的大小,代碼為【select concat(round(sum(DATA_LENGTH/1024/1024),2),’MB’)】;2、查詢某個庫的大小,代碼為【from informati】。

mysql查詢數(shù)據(jù)庫的大小

相關學習推薦:mysql數(shù)據(jù)庫

mysql查詢數(shù)據(jù)庫的大小的方法:

1、查詢整個mysql數(shù)據(jù)庫,整個庫的大小;單位轉(zhuǎn)換為MB。

select?concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')?as?data??from?information_schema.TABLES

mysql查詢數(shù)據(jù)庫的大小

2、查詢mysql數(shù)據(jù)庫,某個庫的大?。?/p>

select?concat(round(sum(DATA_LENGTH/1024/1024),2),'MB')?as?data ??from?information_schema.TABLES ?where?table_schema?=?'testdb'

mysql查詢數(shù)據(jù)庫的大小

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';

mysql查詢數(shù)據(jù)庫的大小

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%';

mysql查詢數(shù)據(jù)庫的大小

以上就是

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點贊15 分享