码迷,mamicode.com
首页 > 数据库 > 详细

dos下连接mysql,显示表结构

时间:2014-09-09 15:38:18      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   os   io   java   ar   strong   

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;

dos下连接mysql,显示表结构

标签:des   style   blog   color   os   io   java   ar   strong   

原文地址:http://www.cnblogs.com/q446223455/p/3962445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!