zoukankan      html  css  js  c++  java
  • desc和show

    desc只能查看表结构

    查看zx1表结构

    desc zx1;

    mysql> desc zx1
        -> ;
    +---------+---------+------+-----+---------+-------+
    | Field   | Type    | Null | Key | Default | Extra |
    +---------+---------+------+-----+---------+-------+
    | zx_name | char(1) | YES  |     | NULL    |       |
    | age     | int(11) | YES  |     | NULL    |       |
    +---------+---------+------+-----+---------+-------+
    

    show可以用来查看创建语句和查看数据库和表

    查看zx1表创建语句

    show create table zx1;

    mysql> show create table zx1;
    +-------+--------------------------------------------------------------------------------------------------------------------------+
    | Table | Create Table                                                                                                             |
    +-------+--------------------------------------------------------------------------------------------------------------------------+
    | zx1   | CREATE TABLE `zx1` (
      `zx_name` char(1) DEFAULT NULL,
      `age` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
    +-------+--------------------------------------------------------------------------------------------------------------------------+
    

    查看创建库的语句

    show create database db1;

    mysql> show create database db1;
    +----------+--------------------------------------------------------------+
    | Database | Create Database                                              |
    +----------+--------------------------------------------------------------+
    | db1      | CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */ |
    +----------+--------------------------------------------------------------+
    

    查看数据库

    show databases;

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | db1                |
    | db2                |
    | db3                |
    | db4                |
    | fdg                |
    | mysql              |
    | performance_schema |
    | test               |
    +--------------------+
    

    查看数据表

    show tables;

    mysql> show tables;
    +---------------+
    | Tables_in_db1 |
    +---------------+
    | zx1           |
    +---------------+
    
  • 相关阅读:
    上架的问题
    moya rxswift的简单实用
    MySql的简单使用,所有的代码基于MAC
    H5测试区别与PC端测试关注点
    测试小结
    测试之找回密码
    转Web安全测试之XSS
    一个最简单的登录页面测试case
    web测试特别点
    关于web测试
  • 原文地址:https://www.cnblogs.com/zx125/p/11575553.html
Copyright © 2011-2022 走看看