mysql 查看数据库中所有表的记录数

USE information_schema;

SELECT DISTINCT
    t.table_name,
    t.ENGINE '表引擎',
    t.table_rows 
FROM
    TABLES t 
WHERE
    1 = 1 -- 自己数据库的名字
    AND t.table_schema = 'mysql_database_name' 
    AND t.ENGINE IS NOT NULL 
ORDER BY
    t.table_name,
    t.table_rows;
    
    

 

SELECT
    t.TABLE_SCHEMA '数据库',
    t.TABLE_COMMENT '表注释',
    t.TABLE_name '表名',
    t.TABLE_TYPE '表类型',
    t.TABLE_ROWS '行数',
    t.CREATE_TIME '创建时间',
    t.update_TIME '最后修改时间',
    c.COLUMN_NAME '列名',
    c.column_comment '字段注释',
    c.COLUMN_KEY '主键',
    c.DATA_TYPE '类型',
    c.COLUMN_TYPE '长类型',
    c.CHARACTER_MAXIMUM_LENGTH '长度' 
FROM
    information_schema.TABLES t
    INNER JOIN information_schema.COLUMNS c ON t.TABLE_SCHEMA = c.TABLE_SCHEMA 
WHERE
    t.table_schema = 'bpmapp53' 
    AND t.table_name = 'person2' 
    AND c.TABLE_NAME = 'person2' 
    LIMIT 100 

 

posted @ 2016-04-20 17:21  silentmuh  阅读(983)  评论(0编辑  收藏  举报
Live2D