RENAME命令用于更改MySQL表的名稱(chēng)。其語(yǔ)法如下 –
RENAME table old_tablename to new_tablename2;
登錄后復(fù)制
示例
在下面的示例中,我們將表“testing”重命名為“test”。
mysql> RENAME table testing to test; Query OK, 0 rows affected (0.17 sec) 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)
登錄后復(fù)制
以上就是我們?nèi)绾胃?MySQL 表的名稱(chēng)?的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注www.92cms.cn其它相關(guān)文章!