13.1.36 RENAME TABLE Statement RENAME TABLE Statement 2617 The  IF EXISTS  clause prevents an error from occurring for views that don’t exist. When this clause is given, a  NOTE  is generated for each nonexistent view. See Section 13.7.7.42, “SHOW WARNINGS Statement” . RESTRICT  and  CASCADE , if given, are parsed and ignored. RENAME TABLE tbl_name  TO  new_tbl_name [,  tbl_name2  TO  new_tbl_name2 ] ... RENAME TABLE old_table1 TO new_table1, old_table2 TO new_table2, old_table3 TO new_table3; RENAME TABLE old_table TO tmp_table, new_table TO old_table, tmp_table TO new_table; LOCK TABLE old_table1 WRITE; RENAME TABLE old_table1 TO new_table1, new_table1 TO new_table2; LOCK TABLE old_table1 READ; RENAME TABLE old_table1 TO new_table1, new_table1 TO new_table2; If any errors occur during a  RENAME TABLE , the statement fails and no changes are made. With the transaction table locking conditions satisfied, the rename operation is done atomically; no other session can access any of the tables while the rename is in progress. Prior to MySQL 8.0.13, to execute  RENAME TABLE , there must be no tables locked with  LOCK TABLES This is not permitted: As of MySQL 8.0.13, you can rename tables locked with a  LOCK TABLES  statement, provided that they are locked with a  WRITE  lock or are the product of renaming  WRITE -locked tables from earlier steps in a multiple-table rename operation. For example, this is permitted: Metadata locks on tables are acquired in name order, which in some cases can make a difference in operation outcome when multiple transactions execute concurrently. See Section 8.11.4, “Metadata Locking” . Renaming operations are performed left to right. Thus, to swap two table names, do this (assuming that a table with the intermediary name  tmp_table  does not already exist): RENAME TABLE , unlike  ALTER TABLE , can rename multiple tables within a single statement: ALTER TABLE old_table RENAME new_table; That statement is equivalent to the following  ALTER TABLE  statement: RENAME TABLE old_table TO new_table; For example, to rename a table named  old_table  to  new_table , use this statement: RENAME TABLE  renames one or more tables. You must have  ALTER  and  DROP  privileges for the original table, and  CREATE  and  INSERT  privileges for the new table.