| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
31 rows in set (0.00 sec)
show columns from 数据表:
显示数据表的属性,属性类型,主键信息 ,是否为 NULL,默认值等其他信息。
root@localhost> show columns from db; | |||||
---|---|---|---|---|---|
Field | Type | Null | Key | Default | Extra |
Host | char(60) | NO | PRI | ||
Db | char(64) | NO | PRI | ||
User | char(32) | NO | PRI | ||
Select_priv | enum('N','Y') | NO | N | ||
Insert_priv | enum('N','Y') | NO | N | ||
Update_priv | enum('N','Y') | NO | N | ||
Delete_priv | enum('N','Y') | NO | N | ||
Create_priv | enum('N','Y') | NO | N | ||
Drop_priv | enum('N','Y') | NO | N | ||
Grant_priv | enum('N','Y') | NO | N | ||
References_priv | enum('N','Y') | NO | N | ||
Index_priv | enum('N','Y') | NO | N | ||
Alter_priv | enum('N','Y') | NO | N | ||
Create_tmp_table_priv | enum('N','Y') | NO | N | ||
Lock_tables_priv | enum('N','Y') | NO | N | ||
Create_view_priv | enum('N','Y') | NO | N | ||
Show_view_priv | enum('N','Y') | NO | N | ||
Create_routine_priv | enum('N','Y') | NO | N | ||
Alter_routine_priv | enum('N','Y') | NO | N | ||
Execute_priv | enum('N','Y') | NO | N | ||
Event_priv | enum('N','Y') | NO | N | ||
Trigger_priv | enum('N','Y') | NO | N |
22 rows in set (0.00 sec)
show index from 数据表:
显示数据表的详细索引信息,包括primary key(主键)。
show index from db; | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
db | 0 | PRIMARY | 1 | Host | A | NULL | NULL | NULL | BTREE | |||
db | 0 | PRIMARY | 2 | Db | A | NULL | NULL | NULL | BTREE | |||
db | 0 | PRIMARY | 3 | User | A | 2 | NULL | NULL | BTREE | |||
db | 1 | User | 1 | User | A | NULL | NULL | NULL | BTREE |
4 rows in set (0.00 sec)
show table status [from db_name] [like 'pattern'] \G:该命令将输出Mysql数据库管理系统的性能及统计信息。
mysql> SHOW TABLE STATUS FROM RUNOOB; # 显示数据库 RUNOOB 中所有表的信息
mysql> SHOW TABLE STATUS from RUNOOB LIKE 'runoob%'; # 表名以runoob开头的表的信息
mysql> SHOW TABLE STATUS from RUNOOB LIKE 'runoob%'\G; # 加上 \G,查询结果按列打印