mysqldump -u username -p dbname > dbname.sql
清空表数据 delete from xxxx;
插入一条数据 insert into tablename values(a,b,c..);
插入不全的数据/完善 insert into table (a,b,c..) values(xa,xb,xc...);
更改数据 ;
属性列重命名 );
从文件导入数据 load data infile "/home/ubuntu/imap/src/database/data/Treat/projects.txt" into table Projects FIELDS TERMINATED BY '|';
查看warning show warnings;
mysql -h -e "select Team_Name from Teams where status = \"Accepted\" " > ./teamname_ac.txt
今天用到就查了这些,明天用的再说!
添加外码约束 alter table Schools add constraint Area_ID foreign key Schools(Area_ID) references Areas(Area_ID);
添加列:); 删除列:alter table 表名 drop column 列名; 删除外键约束:alter table 表名 drop foreign key 外键;
RENAME TABLE tb_name TO new_tb_name, tb_name2 TO new_tb_name2, …