mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; 示例: use testDB; #切换到testDB数据库 select * from columns where table_name='表名'; #查看表信息 顺便提下MySQL常用语句: show databases; use 数据库名; show tables; 另外Oracle几个有用的语句: select * from…
首先进入到mysql里 show databases; 选择数据库 use xxxcms; 查询数据库下的表结构 show create table 表名; 这样看着不太好可以后面加\G show create table 表名\G; 如上所示并没有索引创建 下面来查询一下索引 show indexes from 表名\G; 图11 以上返回值的官方介绍 http://dev.mysql.com/doc/refman/5.6/en/show-index.html 主要Key_name 索引的名字…
use information_schema; select column_name, column_type, data_type, is_nullable, column_comment from columns where table_name='表名'; use ykee_baseshow full columns from 表名;…
select Column_name as 列名,is_nullable as 是否可为空,data_type as 数据类型,column_default as 默认值,case when column_key ='PRI' then '主键' when column_key ='UNI' then '唯一约束' when column_key ='MUL' then '可以重复' else '' end as 列键,column_comment as 字段说明 from informatio…
MySQL查看表结构SQL语句 = mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; use information_schema; #切换到information_schema数据库 select * from columns where table_name='表名'; #查看表信息 顺便提下MySQL常用语句: show databases; use 数据库名; show t…