mysql一些边角知识
1.重命名表
语法:
RENAME TABLE tbl_name TO new_tbl_name
[, tbl_name2 TO new_tbl_name2] ...
[, tbl_name2 TO new_tbl_name2] ...
eg: rename table idcard to stuIdCard;
2.删除外键
语法:
ALTER TABLE table_name DROP FOREIGN KEY fk_name
eg:
ALTER TABLE articles DROP FOREIGN KEY fk_member
3. 字段重命名:
语法:
alter table tablename change old_field_name new_field_name old_type;
eg:
alter table teacher change teacher_id student_id int
4.运行.sql文件
\. xxx.sql(路径)