The following articles mainly describe the actual application commands for MySQL to view the table structure. If you encounter MySQL to view the table structure in actual operations, but you do not know how to run it correctly, so the following articles must be good teachers and friends for you.
Run the following command to view the table structure in MySQL:
Desc table name;
Show columns from table name;
Describe table name;
Show create table name;
Use information_schema
Select * from columns where table_name = 'table name ';
By the way:
Show databases;
Use Database Name;
Show tables;
The original unique index AK_PAS_Name (PAC_Name) is in the tb_webparamcounter table,
Run the following SQL statement 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 index logic is incorrect, you need to add another field to 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: The PC_ID, PAC_Name, and PAC_Value fields are not FOREIGN keys.
Otherwise, you must first drop foreign key and then redo the previous step.
By the way, oracle
- select * from v$database;
- select * from all_users;
- select * from user_tables;
The above content is the description of the MySQL table structure command, which may help you in this regard.