MySQL 数据结构常用命令

查询数据表结构

select TABLE_NAME, TABLE_TYPE, ENGINE, DATA_LENGTH, CREATE_TIME, TABLE_COLLATION, TABLE_COMMENT 
    from information_schema.tables where TABLE_SCHEMA=:database AND TABLE_TYPE=‘BASE TABLE‘ order by TABLE_NAME

查询数据字段

select COLUMN_NAME, ORDINAL_POSITION, COLUMN_DEFAULT, COLUMN_TYPE, IS_NULLABLE, EXTRA, DATA_TYPE, 
    CHARACTER_MAXIMUM_LENGTH, NUMERIC_PRECISION, NUMERIC_SCALE, COLUMN_KEY, COLUMN_COMMENT from 
    information_schema.columns WHERE TABLE_SCHEMA=:database AND TABLE_NAME=:table order by ORDINAL_POSITION

MySQL 数据结构常用命令

上一篇:Autofac.Core.Activators.Reflection.NoConstructorsFoundException: No accessible constructors were found for the type


下一篇:MySQL之——hash索引和B+Tree索引