本文主要給大家介紹如何查看MySQL數(shù)據(jù)庫(kù)表容量的大小,文章內(nèi)容都是筆者用心摘選和編輯的,具有一定的針對(duì)性,對(duì)大家的參考意義還是比較大的,下面跟筆者一起了解下如何查看MySQL數(shù)據(jù)庫(kù)表容量的大小吧。
在枝江等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站制作、網(wǎng)站建設(shè) 網(wǎng)站設(shè)計(jì)制作按需求定制開發(fā),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站設(shè)計(jì),營(yíng)銷型網(wǎng)站建設(shè),成都外貿(mào)網(wǎng)站建設(shè),枝江網(wǎng)站建設(shè)費(fèi)用合理。
1.查看所有數(shù)據(jù)庫(kù)容量大小
select table_schema as '數(shù)據(jù)庫(kù)',sum(table_rows) as '記錄數(shù)',sum(truncate(data_length/1024/1024, 2)) as '數(shù)據(jù)容量(MB)',sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'from information_schema.tablesgroup by table_schemaorder by sum(data_length) desc, sum(index_length) desc;
2.查看所有數(shù)據(jù)庫(kù)各表容量大小
select table_schema as '數(shù)據(jù)庫(kù)', table_name as '表名', table_rows as '記錄數(shù)',truncate(data_length/1024/1024, 2) as '數(shù)據(jù)容量(MB)',truncate(index_length/1024/1024, 2) as '索引容量(MB)'from information_schema.tablesorder by data_length desc, index_length desc;
3.查看指定數(shù)據(jù)庫(kù)容量大小
例:查看mysql庫(kù)容量大小
select table_schema as '數(shù)據(jù)庫(kù)',sum(table_rows) as '記錄數(shù)',sum(truncate(data_length/1024/1024, 2)) as '數(shù)據(jù)容量(MB)',sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'from information_schema.tableswhere table_schema='mysql';
4.查看指定數(shù)據(jù)庫(kù)各表容量大小
例:查看mysql庫(kù)各表容量大小
select table_schema as '數(shù)據(jù)庫(kù)', table_name as '表名', table_rows as '記錄數(shù)',truncate(data_length/1024/1024, 2) as '數(shù)據(jù)容量(MB)',truncate(index_length/1024/1024, 2) as '索引容量(MB)'from information_schema.tableswhere table_schema='mysql'order by data_length desc, index_length desc;
看完以上關(guān)于如何查看MySQL數(shù)據(jù)庫(kù)表容量的大小,很多讀者朋友肯定多少有一定的了解,如需獲取更多的行業(yè)知識(shí)信息 ,可以持續(xù)關(guān)注我們的行業(yè)資訊欄目的。