DataBase/Mysql

Mysql 테이블 이름 변경하기 (Table RENAME)

민돌v 2021. 8. 5. 18:16
728x90

단일 테이블 이름 변경 (RENAME)

RENAME TABLE old_table TO new_table;

ex)

rename table 24shop to AllTimeShop;

 

단일 테이블 이름 변경 (ALTER)

ALTER TABLE old_table RENAME new_table;

 


RENAMEALTER RENAME의 차이

RENAME을 사용하면 다수의 테이블이름 변경이 가능하다.

다수 테이블 이름 변경

RENAME TABLE old_table1 TO new_table1,
             old_table2 TO new_table2,
             old_table3 TO new_table3;
반응형