// 数据库列表
SHOW DATABASES;
-- 字段列
- Database
// 进入指定数据库
USE [DATABASE];
// 查看当前数据库
SELECT DATABASE();
-- 字段列
- database()
// 表列表
SHOW TABLES;
-- 字段列
- Tables_in_[database_name]
// 库详情
select * from information_schema.tables where table_schema='test';
- 字段列 - description - e.g
---------------------------------------------------------
- TABLE_CATALOG - - def
- TABLE_SCHEMA - database name - mysql
- TABLE_NAME - table name - user
- TABLE_TYPE - table type - BASE TABLE
- ENGINE - 引擎 - InnoDB
- VERSION - 版本 - 10
- ROW_FORMAT - 格式化 - Dynamic
- TABLE_ROWS - 数据行 - 82
- AVG_ROW_LENGTH - 平均长度 - 376
- DATA_LENGTH - 表大小 - 98304
- MAX_DATA_LENGTH - - 0
- INDEX_LENGTH - 索引 - 49152
- DATA_FREE - 自由空间 - 0
- AUTO_INCREMENT - 自增值 - 6
- CREATE_TIME - 创建时间 - 2017-08-13 12:37:03
- UPDATE_TIME - 更新时间 - 2018-01-10 22:09:02
- CHECK_TIME - 检测时间 - NULL
- TABLE_COLLATION - 排序规则 - utf8_general_ci
- CHECKSUM - - NULL
- CREATE_OPTIONS - -
- TABLE_COMMENT - 表注释 - 用户表
// 表定义
describe [table_name];
-- 字段列
- Field
- Type
- Null
- Key
- Default
- Extra
// 表详情
select * from information_schema.tables where table_name ='user';
// 参考库详情字段列表
参考: https://dev.mysql.com/doc/refman/5.7/en/innodb-information-schema.html