dos下连接mysql,显示表结构
C:\Windows\system32>mysql -hlocalhoset -uroot -p Enter password: ***** mysql> use ssh Database changed mysql> show tables; +----------------+ | Tables_in_ssh | +----------------+ | admin | | department | | privilege | | privilege_role | | role | | user_role | +----------------+ 6 rows in set (0.00 sec)
//显示表结构 1)mysql> desc admin; +---------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+-------+ | id | varchar(255) | NO | PRI | NULL | | | name | varchar(255) | YES | | NULL | | | account | varchar(255) | YES | | NULL | | | password | varchar(255) | YES | | NULL | | | addTime | datetime | YES | | NULL | | | delSign | varchar(255) | YES | | NULL | | | lockStatus | varchar(255) | YES | | NULL | | | phone | varchar(255) | YES | | NULL | | | email | varchar(255) | YES | | NULL | | | nowLoginTime | datetime | YES | | NULL | | | nowLoginIp | varchar(255) | YES | | NULL | | | lastLoginTime | datetime | YES | | NULL | | | lastLoginIp | varchar(255) | YES | | NULL | | | loginCount | int(11) | YES | | NULL | | | description | varchar(255) | YES | | NULL | | | gender | varchar(255) | YES | | NULL | | | birthday | datetime | YES | | NULL | | | icon | varchar(255) | YES | | NULL | | | qq | varchar(255) | YES | | NULL | | | address | text | YES | | NULL | | | departmentId | varchar(255) | YES | MUL | NULL | | +---------------+--------------+------+-----+---------+-------+
2)mysql> show create table admin;
------------------------------------+
| admin | CREATE TABLE `admin` (
`id` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`account` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`addTime` datetime DEFAULT NULL,
`delSign` varchar(255) DEFAULT NULL,
`lockStatus` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`nowLoginTime` datetime DEFAULT NULL,
`nowLoginIp` varchar(255) DEFAULT NULL,
`lastLoginTime` datetime DEFAULT NULL,
`lastLoginIp` varchar(255) DEFAULT NULL,
`loginCount` int(11) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`gender` varchar(255) DEFAULT NULL,
`birthday` datetime DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`qq` varchar(255) DEFAULT NULL,
`address` text,
`departmentId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK586034F91261A86` (`departmentId`),
CONSTRAINT `FK586034F91261A86` FOREIGN KEY (`departmentId`) REFERENCES `department` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+--------------------------------------------------------------------------------------
3)show columns from admin;
4)describe admin;
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。