RENAME命令用于更改MySQL表的名称。它的语法如下-
RENAME table old_tablename to new_tablename2;
在下面的示例中,我们将表“ testing”重命名为“ test”。
mysql> RENAME table testing to test; mysql> Select * from testing; ERROR 1146 (42S02): Table 'query.testing' doesn't exist mysql> Select * from test; +-----+---------+ | id1 | Name | +-----+---------+ | 1 | Harshit | | 2 | Lovkesh | | 3 | MOHIT | | 4 | MOHIT | +-----+---------+ 4 rows in set (0.02 sec)