Home  >  Article  >  Database  >  mysql查看所有表的记录数

mysql查看所有表的记录数

WBOY
WBOYOriginal
2016-06-07 15:09:421346browse

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 记录一下mysql中查看所有表的记录数: TABLE_SCHEMA : 数据库名 TABLE_NAME:表名 ENGINE:所使用的存储引擎 TABLES_ROWS:记录数 DATA_LENGTH:数据大小 得到的结果是以字节为单位,除1024为K,除10

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  记录一下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查看所有表的记录数

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn