10 Aug 2022

MYSQL 강제삭제



mysql> SET foreign_key_checks = 0; // 체크 해제 mysql> drop TABLE [테이블명] mysql> SET foreign_key_checks = 1; // 다시 체크 설정

테이블 이름 바꾸기

단일 테이블 이름 변경 RENAME TABLE old_table TO new_table; or,

ALTER TABLE old_table RENAME new_table;

다수 테이블 이름 변경 RENAME TABLE old_table1 TO new_table1, old_table2 TO new_table2, old_table3 TO new_table3;

다른 데이터베이스로 테이블 이동

RENAME TABLE current_db.table_name TO other_db.table_name;

출처: https://extbrain.tistory.com/61 [확장형 뇌 저장소:티스토리]