Introduction to the MySQL command used to view the table structure

Source: Internet
Author: User
The following articles mainly describe the actual operation steps of the MySQL command to view the table structure. The detailed analysis of the specific solution is as follows, it is expected that you will be able to learn the actual operation commands for viewing table structures in MySQL in the future. The following describes the main content of the text. As follows: desc table name; showcolumnsfrom table name; describe table name;

The following articles mainly describe the actual operation steps of the MySQL command to view the table structure. The detailed analysis of the specific solution is as follows, it is expected that you will be able to learn the actual operation commands for viewing table structures in MySQL in the future. The following describes the main content of the text. As follows: desc table name; showcolumnsfrom table name; describe table name;

The following articles mainly describe the actual operation steps of the MySQL command to view the table structure. The detailed analysis of the specific solution is as follows, it is expected that you will be able to learn the actual operation commands for viewing table structures in MySQL in the future. The following describes the main content of the text.

As follows:

 
 
  1. Desc table name;
  2. Show columns from table name;
  3. Describe table name;
  4. Show create table name;
  5. Use information_schema
  6. Select * from columns where table_name = 'table name ';

By the way:

 
 
  1. show databases;

Use Database Name;

 
 
  1. show tables;

MySQL command to view table structure: the original unique index AK_PAS_Name (PAC_Name) in the table tb_webparamcounter, run the following SQL to modify the index

 
 
  1. alter table tb_webparamcounter drop index AK_PAS_Name;
  2. alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);

If you find that the index logic is incorrect, you need to add another field to execute

Note: The PC_ID, PAC_Name, and PAC_Value fields are not FOREIGN keys. Otherwise, you must drop foreign key and redo the previous step.

View the stored procedure;

 
 
  1. show procedure status;

By the way, oracle

 
 
  1. select * from v$database;
  2. select * from all_users;
  3. select * from user_tables;

The above content is an introduction to the MySQL table structure command. I hope you will get something.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.