找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 mysql教程 查看内容

mysql怎么修改表名?

作者:模板之家 2019-5-7 09:47 5036人关注

打开cmd-输入“mysql -u root -p”-输入密码,进入mysql-输入“alter table rename to/as new_tablename;”

本篇文章将和大家讲述如何快速修改mysql表名,有同样需要的朋友学习一下吧,希望你看后能有所帮助。

具体步骤:打开cmd->输入“mysql -u root -p”->输入密码,进入mysql->输入“alter table rename to/as new_tablename;”

下面的代码包括了创建表的过程:

#创建表结构.这样的建表方式,不仅仅是表的结构,连带着索引也会同时创建.
mysql> create table ts01 like ti_o_sms; 
Query OK, 0 rows affected (0.02 sec)

#修改表名的语法:alter table old_tablename rename to/as new_tablename;
mysql> alter table ts01 rename to ts01_new;
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;                      
+--------------------+
| Tables_in_mytest   |
+--------------------+
| sms_send_blacklist |
| td_b_sendobject    |
| ti_o_sms        |
| ts01_new        |
+--------------------+
rows in set (0.00 sec)

相关教程:mysql视频教程

以上就是mysql怎么修改表名?的详细内容,更多请关注模板之家(www.mb5.com.cn)其它相关文章!


路过

雷人

握手

鲜花

鸡蛋
来自: [db:来源]

全部回复(0)

发表评论