檢視mysql資料庫使用大小和mysql修改時間

2021-09-21 04:03:41 字數 545 閱讀 4692

1.檢視mysql大小

use 資料庫名

select sum(data_length)+sum(index_length)

from information_schema.tables where table_schema='資料庫名';

得到的結果是以位元組為單位,除1024為k,除1048576為m。

-----------------------------------------

2.檢視表的最後mysql修改時間

select table_name,update_time from information_schema.tables where table_schema='資料庫名';

可以通過檢視資料庫中表的mysql修改時間,來確定mysql資料庫是否已經長期不再使用。

select round((sum(data_length)+sum(index_length))/1024/1024,1) as size from information_schema.tables where table_schema='資料庫名';

檢視mysql資料庫大小

資料量大的情況下 謹慎使用 mysql會崩潰!資料量大的情況下 謹慎使用 mysql會崩潰!資料量大的情況下 謹慎使用 mysql會崩潰!mysql檢視當前所有的資料庫和索引大小 select table schema,concat truncate sum data length 1024 102...

檢視MySQL資料庫大小

檢視 mysql 資料庫大小 1 進去指定 schema 資料庫 存放了其他的資料庫的資訊 use information schema 2 查詢所有資料的大小 select concat round sum data length 1024 1024 2 mb as data from table...

檢視MySQL資料庫大小

1.首先進入information schema 資料庫 存放了其他的資料庫的資訊 12 mysql use information schema databasechanged 2.檢視大小 1 檢視所有資料庫大小?1mysql selectconcat round sum data length...