mysql查看表结构命令

mysql查看表结构命令,如下:

desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;

use information_schema
select * from columns where table_name='表名';

顺便记下:
show databases;
use 数据库名;
show tables;

原有一unique索引AK_PAS_Name(PAC_Name)在表tb_webparamcounter中,
执行以下sql修改索引
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);

若发现索引的逻辑不对,还需要再加一个字段进去,执行
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name,PAC_Value);
注意:这时的PC_ID,PAC_Name,PAC_Value三个字段不是FOREIGN KEY
否则必需先drop FOREIGN KEY,再重做上一步才行

顺便提下oracle
select * from v$database;
select * from all_users;
select * from user_tables;

mysql查看表结构命令的更多相关文章

  1. mysql查看表结构命令,如下:

    desc 表名; show columns from 表名; describe 表名; show create table 表名;

  2. 查看表结构命令(mysql和oracle)

    MySQL查看表结构SQL语句 = mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; ...

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

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

  4. MySQL 查看表结构

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

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

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

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

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

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

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

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

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

  9. 161215、MySQL 查看表结构简单命令

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

随机推荐

  1. Jackson框架,json转换

    Jackson可以轻松的将Java对象转换成json对象和xml文档,同样也可以将json.xml转换成Java对象. 前面有介绍过json-lib这个框架,在线博文:http://www.cnblo ...

  2. C#数据采集类

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...

  3. java 获取本机ip地址

    /** * 取当前系统站点本地地址 linux下 和 window下可用 * * @return */ public static String getLocalIP() { String sIP = ...

  4. 巧用Red Gate SQL Compare破解加密了的存储过程和函数

      最近项目中遇到了一个遗留系统的存储过程和函数被加密了,网上找了半天,解决办法倒是有,但需要写一大堆脚本, 怕影响原系统的运行,就说先同步到其他服务器上去破解.没想到,打开Sql Compare一比 ...

  5. PHP代码实现MySQL读写分离

    关于MySQL的读写分离有几种方法:中间件,Mysql驱动层,代码控制 关于中间件和Mysql驱动层实现Mysql读写分离的方法,今天暂不做研究, 这里主要写一点简单的代码来实现由PHP代码控制MyS ...

  6. 深入理解计算机系统第二版习题解答CSAPP 2.17

    假设w=4,我们能给每个可能的十六进制数字赋予一个数值,假设用一个无符号或者补码表示.完成下表: x 无符号(B2U(x)) 补码(B2T(x)) 十六进制 二进制 0xE 1110 14 -2 0x ...

  7. c++ 拷贝构造练习

    #include<iostream> using namespace std; class Vector { private: int *dwp; int size; void clone ...

  8. loadjs异步加载javascript回调

    function loadjs(url,callback){    var script=document.createElement('script');     script.type=" ...

  9. [转]Creating Unit Tests for ASP.NET MVC Applications (C#)

    本文转自:http://www.asp.net/mvc/tutorials/older-versions/unit-testing/creating-unit-tests-for-asp-net-mv ...

  10. 信号量 Semaphore

    一.简介         信号量(Semaphore),有时被称为信号灯,是在多线程环境下使用,负责协调各个线程, 以保证它们能够正确.合理的使用公共资源. Semaphore可以控制某个资源可被同时 ...