show columns from tb_name 与 desc tb_name有什么区别
mysql> show columns from tb_user;
+----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| username | varchar(50) | NO | UNI | | |
| password | varchar(32) | NO | | | |
| phone | varchar(20) | YES | UNI | NULL | |
| email | varchar(50) | YES | UNI | NULL | |
| created | datetime | NO | | | |
| updated | datetime | NO | | | |
+----------+-------------+------+-----+---------+----------------+
7 rows in set (0.09 sec)
mysql> desc tb_user;
+----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| username | varchar(50) | NO | UNI | | |
| password | varchar(32) | NO | | | |
| phone | varchar(20) | YES | UNI | NULL | |
| email | varchar(50) | YES | UNI | NULL | |
| created | datetime | NO | | | |
| updated | datetime | NO | | | |
+----------+-------------+------+-----+---------+----------------+
7 rows in set (0.01 sec)