MySQL查詢資料庫的大小

來源:互聯網
上載者:User

MySQL查詢資料庫的大小

第一步:首先開啟Mysql命令列,通過開始菜單-程式-MySql-Command line client,1-1所示:

      圖1-1

第二步:在命令中輸入use information_schema 1-2所示:

圖1-2

第三步:查看指定資料庫的大小,輸入如下語句:

 select concat(round(sum(DATA_LENGTH/1024/1024),2), 'MB') as data from TABLES where table_schema= 'offlineCollectiondb2' ; 其中offlineCollectiondb2是資料庫名稱,換成你需要查詢的資料庫名稱就行,1-3所示:

圖1-3

-------------------------------------------分割線------------------------------------------------------------------------------------

1、查詢所有資料的大小

select concat(round(sum(DATA_LENGTH/1024/1024),2), 'MB') as data from TABLES 2、查看指定資料庫的表的大小,比如說 資料庫test中a表 select concat(round(sum (DATA_LENGTH/1024/1024),2), 'MB') as data from TABLES where table_schema= 'test' and table_name= a;

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.