mysql檢視所有表的記錄數

2021-09-01 12:08:56 字數 509 閱讀 1168

記錄一下mysql中檢視所有表的記錄數:

table_schema : 資料庫名

table_name:表名

engine:所使用的儲存引擎

tables_rows:記錄數

data_length:資料大小 得到的結果是以位元組為單位,除1024為k,除1048576(=1024*1024)為m

index_length:索引大小

use information_schema;

select table_schema,table_name,table_rows from tables order by table_rows desc;

檢視指定資料庫大小:

select sum(data_length)+sum(index_length) from information_schema.tables where table_schema='資料庫名';

得到的結果是以位元組為單位,除1024為k,除1048576(=1024*1024)為m

mysql 檢視資料庫中所有表的記錄數

mysql使用select count from table name可以查詢某個表的總記錄數。想快速的知道資料庫中所有表的記錄數資訊怎麼辦?如果使用mysql的版本在5.0及以上,可以通過查詢information schema庫中的tables表來獲取,該表中使用table rows記錄表的行數...

mysql 檢視資料庫中所有表的記錄數

mysql 使用select count from table name可以查詢某個表的總記錄數。想快速的知道 資料庫中所有表的記錄數資訊怎麼辦?如果使用 mysql 的版本在5.0及以上,可以通過查詢 information schema 庫中的tables表來獲取,該表中使用table rows...

檢視mysql庫中所有表的大小和記錄數

select table name,data length,index length,data length index length as length,table rows,concat round data length index length 1024 1024,3 mb as total...