zoukankan      html  css  js  c++  java
  • mysql 显示表结构

     例子

    mysql> show columns from table1;
    +------------+------------------+------+-----+---------+----------------+
    | Field      | Type             | Null | Key | Default | Extra          |
    +------------+------------------+------+-----+---------+----------------+
    | name_new   | char(32)         | YES  |     | NULL    |                |
    | transactor | varchar(10)      | NO   |     | NULL    |                |
    | pid        | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
    | order_date | datetime         | YES  |     | NULL    |                |
    +------------+------------------+------+-----+---------+----------------+
    4 rows in set (0.00 sec)

     例子

    mysql> desc table1;
    +------------+------------------+------+-----+---------+----------------+
    | Field      | Type             | Null | Key | Default | Extra          |
    +------------+------------------+------+-----+---------+----------------+
    | name_new   | char(32)         | YES  |     | NULL    |                |
    | transactor | varchar(10)      | NO   |     | NULL    |                |
    | pid        | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
    | order_date | datetime         | YES  |     | NULL    |                |
    +------------+------------------+------+-----+---------+----------------+
    4 rows in set (0.00 sec)

     例子

    mysql> show create table table1;
    +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Table  | Create Table                                                                                                                                                                                                                                                            |
    +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | table1 | CREATE TABLE `table1` (
      `name_new` char(32) DEFAULT NULL,
      `transactor` varchar(10) NOT NULL,
      `pid` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `order_date` datetime DEFAULT NULL,
      PRIMARY KEY (`pid`)
    ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 |
    +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

  • 相关阅读:
    iOS tableViewCell自适应高度 第三发类库
    iOS 用 SDWebImage 清理图片缓存
    iOS JsonModel 的使用
    Objective-C语法之KVO使用
    iOS开发之 用第三方类库实现轮播图
    OS开发UI篇—使用UItableview完成一个简单的QQ好友列表
    iOS tableView 静态单元格的实现
    iOS沙盒目录结构解析
    ios开发UI篇—使用纯代码自定义UItableviewcell实现一个简单的微博界面布局
    AFNetworking 3.0.4 的使用
  • 原文地址:https://www.cnblogs.com/sea-stream/p/11300363.html
Copyright © 2011-2022 走看看