MySQL – テーブル名の変更

今回は、mysqlのテーブル名を変更する方法についてメモしていきます。

テーブル名の変更

単一テーブル名を変更
RENAME TABLE old_table TO new_table;
ALTERを使った単一テーブル名を変更
ALTER TABLE old_table RENAME new_table;
複数のテーブル名を変更
RENAME TABLE old_table1 TO new_table1, 
          old_table2 TO new_table2,       
               old_table3 TO new_table3;

コメントを残す