mysql 查看表定义

两种显示表定义

mysql> desc sys_role;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| ROLE_ID | varchar(100) | NO | PRI | NULL | |
| ROLE_NAME | varchar(100) | YES | | NULL | |
| RIGHTS | varchar(255) | YES | | NULL | |
| PARENT_ID | varchar(100) | YES | | NULL | |
| ADD_QX | varchar(255) | YES | | NULL | |
| DEL_QX | varchar(255) | YES | | NULL | |
| EDIT_QX | varchar(255) | YES | | NULL | |
| CHA_QX | varchar(255) | YES | | NULL | |
| QX_ID | varchar(100) | YES | | NULL | |
+-----------+--------------+------+-----+---------+-------+
9 rows in set (0.00 sec)

++++++++++++++++++++++++++++分割线++++++++++++++++++++++++++++++

mysql> show create table sys_role \G;
*************************** 1. row ***************************
Table: sys_role
Create Table: CREATE TABLE `sys_role` (
`ROLE_ID` varchar(100) NOT NULL,
`ROLE_NAME` varchar(100) DEFAULT NULL,
`RIGHTS` varchar(255) DEFAULT NULL,
`PARENT_ID` varchar(100) DEFAULT NULL,
`ADD_QX` varchar(255) DEFAULT NULL,
`DEL_QX` varchar(255) DEFAULT NULL,
`EDIT_QX` varchar(255) DEFAULT NULL,
`CHA_QX` varchar(255) DEFAULT NULL,
`QX_ID` varchar(100) DEFAULT NULL,
PRIMARY KEY (`ROLE_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.02 sec)

ERROR:
No query specified

 

posted @ 2017-04-08 22:21  夏天的西瓜君  阅读(5579)  评论(0编辑  收藏  举报