首页
学习
活动
专区
圈层
工具
发布

mysql查看表结构的几种方式

在我第N次忘记如何查看表结构后,在网上查了一下后,看到有好几种查看表结构的方式,总结一下。 以student(sid,sname,birthday,sex)的查看为例。...语法:describe 表名;———————用于查看表整体结构; 【方式三】:show columns from student; 语法:show columns from...表名;————————–用于查看表整体结构; 【方式四】:show create table student; 语法:show create table 表名;———...—————–用于查看表整体结构; 【方式五】:show full fields from student; 语法:show full fields from 表名;...——————————— 用于查看表整体结构; 【方式六】:show fields from student; 语法:show fields from 表名;—————

4.9K20
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    mysql查看表的数据结构_mysql查找表结构

    MySQL 查看表结构 mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create table 表名; use information_s...… mysql查看表结构命令 mysql查看表结构命令 mysql查看表结构命令,如下: desc 表名;show columns from 表名;describe 表名;show create table...表名; use inf … mysql查看表结构,字段等命令 mysql查看表结构命令,如下: desc 表名; show columns from 表名; describe 表名; show create...’\G; mysql> show table status like ‘x’\G; . row … mysql 查看表结构方法 留给自己备查: mysql 导出为 csv 文件时如果直接使用导出命令是无法导出表结构的..., 因此我们需要能够查询表结构的方法: 方法如下: 1.desc(描述)命令 desc tablename;de … MySQL查看表结构及查看建表语句 查看表结构:desc 表名 mysql> use

    7.7K20

    面试官:MySQL怎么查看表占用空间大小

    前言 在mysql中有一个默认的数据表information_schema,information_schema这张数据表保存了MySQL服务器所有数据库的信息。...再简单点,这台MySQL服务器上,到底有哪些数据库、各个数据库有哪些表,每张表的字段类型是什么,各个数据库要什么权限才能访问,等等信息都保存在information_schema表里面,所以请勿删改此表...concat(round(sum(data_length/1024/1024),2),’MB’) as data from tables where table_schema=’DB_Name’ ; 3,查看表使用大小... as data from tables where table_schema=’DB_Name’ and table_name=’Table_Name’; ---- 网上找的一个,亲测可用: 先进去MySQL...'; 4.查看指定数据库各表容量大小 例:查看mysql库各表容量大小 select table_schema as '数据库', table_name as '表名', table_rows as '

    11.8K00
    领券