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           |
    +---------------+
    
  • 相关阅读:
    Servlet简介
    Tomcat服务器(一)
    Java对象的serialVersion序列化和反序列化
    MySQL中不允许使用列别名作为查询条件
    IF函数
    IFNULL函数
    用Java取指定时区的时间 北京时间,纽约时间,班加罗尔时间
    一个CSV文件解析类
    Java中取两位小数
    JS传中文到后台需要的处理
  • 原文地址:https://www.cnblogs.com/zx125/p/11575553.html
Copyright © 2011-2022 走看看