All table names of a database are returned in Mysql column name data type remarks
- 2020-05-09 19:28:04
- OfStack
desc table name;
show columns from table names;
describe table name;
show create table table names;
use information_schema
select * from columns where table_name=' table name ';
By the way:
show databases;
You can do that
use information_schema
select table_schema,table_name from tables table_schema=' database name '
use database name;
show tables;
The original 1unique index AK_PAS_Name(PAC_Name) is in the table tb_webparamcounter,
Perform the following sql modification index
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);
If the logic of the index is found to be incorrect, one more field needs to be added and executed
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,PAC_Value3 fields are not FOREIGN KEY
Otherwise, you have to do drop FOREIGN KEY and then do it again
Gets column name data type remarks
SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT FROM information_schema.columns WHERE table_name = ?
show columns from table names;
describe table name;
show create table table names;
use information_schema
select * from columns where table_name=' table name ';
By the way:
show databases;
You can do that
use information_schema
select table_schema,table_name from tables table_schema=' database name '
use database name;
show tables;
The original 1unique index AK_PAS_Name(PAC_Name) is in the table tb_webparamcounter,
Perform the following sql modification index
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);
If the logic of the index is found to be incorrect, one more field needs to be added and executed
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,PAC_Value3 fields are not FOREIGN KEY
Otherwise, you have to do drop FOREIGN KEY and then do it again
Gets column name data type remarks
SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT FROM information_schema.columns WHERE table_name = ?