mysql中查看表结构命令

mysql查 看表结构命令,如下:

desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;

use information_schema
select * from columns where table_name=’表名’;

顺便记下:
show databases;
use 数据库名;
show tables;

原有一unique索引AK_PAS_Name(PAC_Name)在表 tb_webparamcounter中,
执行以下sql修改索引
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name);

若发现索引的逻辑不对,还需要再加一个字段进去,执行
alter table tb_webparamcounter drop index AK_PAS_Name;
alter table tb_webparamcounter add UNIQUE AK_PAS_Name(PC_ID,PAC_Name,PAC_Value);
注 意:这时的PC_ID,PAC_Name,PAC_Value三个字段不是FOREIGN KEY
否则必需先drop FOREIGN KEY,再重做上一步才行

顺便提下oracle
select * from v$database;
select * from all_users;
select * from user_tables;

25 thoughts on “mysql中查看表结构命令

  1. Pingback: Accountant in Cambridge MA

  2. Pingback: แมนเชสเตอร์ ยูไนเต็ด

  3. Pingback: flip flops

  4. Pingback: w88club

  5. Pingback: ウォーターサーバー

  6. Pingback: dang ky m88.com

  7. Pingback: poker99

  8. Pingback: aff-casino.com

  9. Pingback: ads free

  10. Pingback: 바카라사이트

  11. Pingback: cbd oil

  12. Pingback: porn

  13. Pingback: 카지노사이트

  14. Pingback: Replica Purse

  15. Pingback: https://enterthenews.pl/forum/

  16. Pingback: online casino

  17. Pingback: winnipeg orthodontics

  18. Pingback: http://68.65.121.73/

  19. Pingback: Ignou Project

  20. Pingback: search

  21. Pingback: Professor Herb CBD - CBD Hemp Flowers

  22. Pingback: KIU-Library/

  23. Pingback: corey zieman reviews

  24. Pingback: best online pharmacy

  25. Pingback: cash bitcoin

Comments are closed.