MySQL学习——查看数据库信息
MySQL学习——查看数据库信息
摘要:本文主要学习了查看数据库信息的方法。
查询指定表的索引
语法
1 show index from 表名;
示例
1 mysql> show index from user; 2 +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 3 | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | 4 +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 5 | user | 0 | PRIMARY | 1 | Host | A | NULL | NULL | NULL | | BTREE | | | 6 | user | 0 | PRIMARY | 2 | User | A | 3 | NULL | NULL | | BTREE | | | 7 +-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 8 2 rows in set (0.00 sec) 9 10 mysql>

更多精彩