• mysql 查询数据库表结构


    1. 

    1 mysql> describe tmp_log;
    2 +----------+------------------+------+-----+---------+----------------+
    3 | Field    | Type             | Null | Key | Default | Extra          |
    4 +----------+------------------+------+-----+---------+----------------+
    5 | id       | int(20) unsigned | NO   | PRI | NULL    | auto_increment |
    6 | url      | varchar(200)     | YES  |     |         |                |
    7 | userName | varchar(200)     | YES  |     |         |                |
    8 +----------+------------------+------+-----+---------+----------------+
    9 3 rows in set (0.01 sec)

    2

     1 mysql> describe tmp_log G;
     2 *************************** 1. row ***************************
     3   Field: id
     4    Type: int(20) unsigned
     5    Null: NO
     6     Key: PRI
     7 Default: NULL
     8   Extra: auto_increment
     9 *************************** 2. row ***************************
    10   Field: url
    11    Type: varchar(200)
    12    Null: YES
    13     Key: 
    14 Default: 
    15   Extra: 
    16 *************************** 3. row ***************************
    17   Field: userName
    18    Type: varchar(200)
    19    Null: YES
    20     Key: 
    21 Default: 
    22   Extra: 
    23 3 rows in set (0.00 sec)
    24 
    25 ERROR: 
    26 No query specified

    3

    1 mysql> desc tmp_log;
    2 +----------+------------------+------+-----+---------+----------------+
    3 | Field    | Type             | Null | Key | Default | Extra          |
    4 +----------+------------------+------+-----+---------+----------------+
    5 | id       | int(20) unsigned | NO   | PRI | NULL    | auto_increment |
    6 | url      | varchar(200)     | YES  |     |         |                |
    7 | userName | varchar(200)     | YES  |     |         |                |
    8 +----------+------------------+------+-----+---------+----------------+
    9 3 rows in set (0.00 sec)

    4

    1 mysql> show  columns from tmp_log;
    2 +----------+------------------+------+-----+---------+----------------+
    3 | Field    | Type             | Null | Key | Default | Extra          |
    4 +----------+------------------+------+-----+---------+----------------+
    5 | id       | int(20) unsigned | NO   | PRI | NULL    | auto_increment |
    6 | url      | varchar(200)     | YES  |     |         |                |
    7 | userName | varchar(200)     | YES  |     |         |                |
    8 +----------+------------------+------+-----+---------+----------------+
    9 3 rows in set (0.00 sec)

    5

    mysql> show create table tmp_log;
    +---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Table   | Create Table                                                                                                                                                                                                                                                     |
    +---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | tmp_log | CREATE TABLE `tmp_log` (
      `id` int(20) unsigned NOT NULL AUTO_INCREMENT,
      `url` varchar(200) DEFAULT '' COMMENT '链接',
      `userName` varchar(200) DEFAULT '' COMMENT '用户名',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8      |
    +---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)
  • 相关阅读:
    MarkDown学习记录
    AngularJS+Ionic开发-2.项目结构介绍
    【二分+贪心+倍增】【NOIP2012】疫情控制
    【考试总结】NOIP模拟 test11-1
    【考试总结】NOIP模拟 test10-27
    【考试总结】AHSOFNU&QZQZ test10-25
    【差分+二分答案】【NOIP2012】借教室
    【动态规划】【NOIP2015】子串
    【高精度+贪心】【NOIP2012】国王游戏
    ICPC Central Russia Regional Contest (CRRC 19)题解
  • 原文地址:https://www.cnblogs.com/gongxijun/p/5673339.html
Copyright © 2020-2023  润新知