简单的mysql数据操作

 
 
无聊简单的记录
mysql -uroot -pgc7232275
show tables
desc tablename
alter table add fieldname fieldtype 
alter table   table1 add id int unsigned not Null auto_increment primary key
alter table TN chang oldfieldname newfieldname fieletyep null or not null
alter table TN modify fieldname fieletyep null or not null
alter table TN drop filename

alter table TN add index index_name(column...)
alter table TN add unique index_name(column)

alter table TN add primary index_name(column...)

ALTER TABLE tbl_name DROP INDEX index_name (column list);
ALTER TABLE tbl_name DROP UNIQUE index_name (column list);
ALTER TABLE tbl_name DROP PRIMARY KEY index_name (column list);
REPAIR TABLE tbl_name QUICK;
SHOW INDEX FROM tbl_name;

你可能感兴趣的:(简单的mysql数据操作)