• dos下连接mysql,显示表结构


    C:Windowssystem32>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;

  • 相关阅读:
    iOS 将对象的属性和属性值拆分成key、value,通过字符串key来获取该属性的值
    [IOI2005] Riv 河流
    [洛谷P4549] [模板] 裴蜀定理
    [NOIp2013] 货车运输
    [NOIp2015] 运输计划
    18.10.01模拟赛总结
    [洛谷P3369] 普通平衡树 Treap & Splay
    [NOIp2016] 组合数问题
    [洛谷P4777] [模板] 扩展中国剩余定理
    [洛谷P3384] [模板] 树链剖分
  • 原文地址:https://www.cnblogs.com/sallet/p/3962445.html
Copyright © 2020-2023  润新知