时间:2021-07-01 10:21:17 帮助过:22人阅读
describe tablename;
show columns tablename;
show create table tablename;
1,2,3展示的是
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| uid | int(11) | NO | | 0 | |
| create_time | int(11) | NO | | NULL | |
| grade | varchar(10) | YES | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
第4中是把创建表的语句打出来,如下;
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t_test | CREATE TABLE `t_test` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT ‘ID‘,
`uid` int(11) NOT NULL DEFAULT ‘0‘ COMMENT ‘用户id‘,
`create_time` int(11) NOT NULL COMMENT ‘发放时间‘,
`grade` varchar(10) DEFAULT NULL COMMENT ‘等级‘,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 |
mysql 查看表结构的指令
标签:mysql 指令 表结构