In MySQL, there are more than one way to rename a table. Renaming a table changes neither a table's structure nor its contents. The following statement renames table tbl1 to tbl2:
ALTER TABLE tbl1 RENAME TO tbl2;
Another way to rename a table is by using the RENAME TABLE statement:
RENAME TABLE tbl1 TO tbl2;
RENAME TABLE has an advantage over ALTER TABLE in that it can perform multiple table renames in a single operation. One use for this feature is to swap the names of two tables:
RENAME TABLE tbl1 TO tmp, tbl2 TO tbl1, tmp TO tbl2;
For TEMPORARY tables, RENAME TABLE does not work. You must use ALTER TABLE instead.