sql檢視mysql中各資料庫大小 yes5144

2022-09-23 03:39:13 字數 581 閱讀 5392

用sql命令檢視mysql資料庫大小

要想知道每個資料庫的大小的話,步驟如下:

1、進入information_schema 資料庫(存放了其他的資料庫的資訊)

use information_schema;

2、查詢所有資料的大小:

select concat(round(sum(data_length/1024/1024),2),'mb') as data from tables;

3、檢視指定資料庫的大小:

比如檢視資料庫home的大小

select concat(round(sum(data_length/1024/1024),2),'mb') as data from tables where table_schema='home';

4、檢視指定資料庫的某個表的大小

比如檢視資料庫home中 members 表的大小

select concat(round(sum(data_length/1024/1024),2),'mb') as data from tables where table_schema='home' and table_name='members';

MySQL中檢視資料庫

檢視當前使用的資料庫,可使用如下命令 mysql select database 使用函式database mysql show tables 列頭資訊中可看出當前使用的db,格式為 tables in db name mysql status 注意結果中的 current database 資訊 ...

MySQL中檢視資料庫

檢視當前使用的資料庫,可使用如下命令 mysql select database 使用函式database mysql show tables 列頭資訊中可看出當前使用的db,格式為 tables in db name mysql status 注意結果中的 current database 資訊 ...

各資料庫對比

現在已有很多大公司使用了nosql google facebook adobe 資料庫型別 儲存型別 部分代表 特點nosql非關係型資料庫 文件儲存 mongodb 文件儲存一般用類似json的格式儲存,儲存的內容是文件型的。這樣也就有機會對某些字段建立索引,實現關聯式資料庫的某些功能。mongo...