MySQL View table structure command

Source: Internet
Author: User

MySQL View table structure command

MySQL view table structure command, as follows:

DESC table name;
Show columns from table name;
describe table name;
Show create table table name;

Use Information_schema
SELECT * from columns where table_name= ' table name ';

By the way note:
show databases;
Use database name;
Show tables;



The original unique index Ak_pas_name (pac_name) is in table Tb_webparamcounter,
Execute the following SQL to modify the index
ALTER TABLE Tb_webparamcounter DROP INDEX ak_pas_name;
ALTER TABLE Tb_webparamcounter add UNIQUE ak_pas_name (pc_id,pac_name);

If you find that the logic of the index is not correct, you need to add a field to go in, execute
ALTER TABLE Tb_webparamcounter DROP INDEX ak_pas_name;
ALTER TABLE Tb_webparamcounter add UNIQUE ak_pas_name (pc_id,pac_name,pac_value);
Note: Pc_id,pac_name,pac_value Three fields at this time are not foreign KEY
Otherwise, you must drop FOREIGN KEY First and then redo the previous step.

By the Way Oracle
SELECT * from V$database;
SELECT * from All_users;
SELECT * from User_tables;

MySQL View table structure command

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.