How to view the table structure in mysql? The following article will introduce to you the commonly used methods to view the mysql table structure. I hope it will be helpful to you.
Mysql method to view the table structure:
1. Use the desc command
Syntax:
desc 表名;
Example: Take the view of student (sid,sname,birthday,sex) as an example
Use the following command to view the table structure:
desc student;
2. Use the describe command
Syntax:
describe 表名;
3. Use the show command
The show command can be used in many ways to view the table structure:
Syntax 1:
show columns from 表名;
Syntax 2:
show create table 表名;
Example:
show create table student;
Grammar 3:
show full fields from 表名;
Example:
show full fields from student;## Grammar 4:
show fields from 表名;Example:
show fields from student;
The above is the detailed content of How to view the table structure in mysql?. For more information, please follow other related articles on the PHP Chinese website!