MySQL 如何更改MySQL表的名称?
RENAME命令用于更改MySQL表的名称。其语法如下——
RENAME table old_tablename to new_tablename2;
阅读更多:MySQL 教程
示例
在下面的示例中,我们将表’testing’重命名为’test’。
mysql> RENAME table testing to test;
查询 OK,受影响的行数为0 (0.17 sec)
mysql> Select * from testing;
错误 1146(42S02):表 'query.testing'不存在
mysql> Select * from test;
+-----+---------+
| id1 | Name |
+-----+---------+
| 1 | Harshit |
| 2 | Lovkesh |
| 3 | MOHIT |
| 4 | MOHIT |
+-----+---------+
共4行(0.02秒)