1.
1 mysql> describe tmp_log; 2 +----------+------------------+------+-----+---------+----------------+ 3 | Field | Type | Null | Key | Default | Extra | 4 +----------+------------------+------+-----+---------+----------------+ 5 | id | int(20) unsigned | NO | PRI | NULL | auto_increment | 6 | url | varchar(200) | YES | | | | 7 | userName | varchar(200) | YES | | | | 8 +----------+------------------+------+-----+---------+----------------+ 9 3 rows in set (0.01 sec)
2
1 mysql> describe tmp_log G; 2 *************************** 1. row *************************** 3 Field: id 4 Type: int(20) unsigned 5 Null: NO 6 Key: PRI 7 Default: NULL 8 Extra: auto_increment 9 *************************** 2. row *************************** 10 Field: url 11 Type: varchar(200) 12 Null: YES 13 Key: 14 Default: 15 Extra: 16 *************************** 3. row *************************** 17 Field: userName 18 Type: varchar(200) 19 Null: YES 20 Key: 21 Default: 22 Extra: 23 3 rows in set (0.00 sec) 24 25 ERROR: 26 No query specified
3
1 mysql> desc tmp_log; 2 +----------+------------------+------+-----+---------+----------------+ 3 | Field | Type | Null | Key | Default | Extra | 4 +----------+------------------+------+-----+---------+----------------+ 5 | id | int(20) unsigned | NO | PRI | NULL | auto_increment | 6 | url | varchar(200) | YES | | | | 7 | userName | varchar(200) | YES | | | | 8 +----------+------------------+------+-----+---------+----------------+ 9 3 rows in set (0.00 sec)
4
1 mysql> show columns from tmp_log; 2 +----------+------------------+------+-----+---------+----------------+ 3 | Field | Type | Null | Key | Default | Extra | 4 +----------+------------------+------+-----+---------+----------------+ 5 | id | int(20) unsigned | NO | PRI | NULL | auto_increment | 6 | url | varchar(200) | YES | | | | 7 | userName | varchar(200) | YES | | | | 8 +----------+------------------+------+-----+---------+----------------+ 9 3 rows in set (0.00 sec)
5
mysql> show create table tmp_log; +---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tmp_log | CREATE TABLE `tmp_log` ( `id` int(20) unsigned NOT NULL AUTO_INCREMENT, `url` varchar(200) DEFAULT '' COMMENT '链接', `userName` varchar(200) DEFAULT '' COMMENT '用户名', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 | +---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)