一、简单描述表结构,字段类型desc tabl_name;
显示表结构,字段类型,主键,是否为空等属性,但不显示外键。
二、查询表中列的注释信息
select * from information_schema.columns where table_schema = 'db' #表所在数据库
and table_name = 'tablename' ; #你要查的表
三、只查询列名和注释
select column_name,
column_comment from information_schema.columns where table_schema ='db' and
table_name = 'tablename' ;
四、#查看表的注释
select table_name,table_comment from information_schema.tables where table_schema = 'db' and table_name ='tablename'
ps:二~四是在元数据表中查看,我在实际操作中,常常不灵光,不知为什么,有了解的大侠请留印。
五、查看表生成的DDL show create table table_name;

161215、MySQL 查看表结构简单命令的更多相关文章

  1. MySQL 查看表结构简单命令

    一.简单描述表结构,字段类型 desc tabl_name; 显示表结构,字段类型,主键,是否为空等属性,但不显示外键. 例如:desc table_name 二.查询表中列的注释信息 select ...

  2. MySQL 查看表结构简单命令。

    一.简单描述表结构,字段类型 desc tabl_name; 显示表结构,字段类型,主键,是否为空等属性,但不显示外键. 二.查询表中列的注释信息 select * from information_ ...

  3. Mysql 查看表结构的命令

    创建数据库create database abc; 显示数据库 show databases; 使用数据库 use 数据库名; 直接打开数据库 mysql -h localhost -u root - ...

  4. mysql查看表结构命令

    mysql查看表结构命令 mysql查看表结构命令,如下: desc 表名;show columns from 表名;describe 表名;show create table 表名; use inf ...

  5. mysql查看表结构,字段等命令

    mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名;

  6. MySQL 查看表结构

    mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; use information_s ...

  7. MySQL查看表结构及查看建表语句

    查看表结构:desc 表名 mysql> use recommend; Database changed mysql> desc user; +--------------+------- ...

  8. mysql查看表结构2种方式对比

    1.desc t_bookType; 2.show create table t_bookType; 相信大部分人还是喜欢第一种查看表结构方式.

  9. mysql 查看表结构方法

    留给自己备查: mysql 导出为 csv 文件时如果直接使用导出命令是无法导出表结构的, 因此我们需要能够查询表结构的方法: 方法如下: 1.desc(描述)命令 desc tablename;de ...

随机推荐

  1. [LintCode] Intersection of Two Arrays II 两个数组相交之二

    Given two arrays, write a function to compute their intersection.Notice Each element in the result s ...

  2. [CareerCup] 16.3 Dining Philosophers 哲学家聚餐问题

    16.3 In the famous dining philosophers problem, a bunch of philosophers are sitting around a circula ...

  3. 服务器由于redis未授权漏洞被攻击

    昨天阿里云拦截到了一次异常登陆,改了密码后就没有管他, 今天阿里云给我发消息说我的服务器可能被黑客利用,存在恶意发包行为....... 不过我不打算只是单纯的重置系统,经过一系列的查找原因后,发现被攻 ...

  4. linux笔记八---------文件查找

    1.find文件查找指令 > find  目录  参数 参数值,参数 参数值.....    > find  /  -name  passwd   //从系统根目录开始递归查找name=p ...

  5. Hibernate HQL的update方法详解

    虽然hibernate提供了许多方法对数据库进行更新,但是这的确不能满足开发需要.现在讲解一下用hql语句对数据进行更新. 不使用参数绑定格式String hql="update User ...

  6. 实时输出TextField中内容

    要想实时输出TextField中内容,要找到textField内容发现改变就会调用的函数,即 - (BOOL)textField:(UITextField *)textField shouldChan ...

  7. numpy使用

    计算矩阵的一些用法: http://www.360doc.com/content/13/1104/17/9934052_326603249.shtml

  8. find exec 运用

    实例1:ls -l命令放在find命令的-exec选项中 : find . -type f -exec ls -l {} \;  实例2:在目录中查找更改时间在n日以前的文件并删除它们: find . ...

  9. html中select只读显示

    因为Select下拉框只支持disabled属性,不支持readOnly属性,而在提交时,disabled的控件,又是不提交值的.现提供以下几种解决方案: 1.在html中使用以下代码,在select ...

  10. 数据访问的历史 Windows

    节选:Programming Microsoft Visual Basic 6.0 1999 The Data Access Saga All the new database-related cap ...