重庆小潘seo博客

当前位置:首页 > 重庆网络营销 > 小潘杂谈 >

小潘杂谈

mysql怎么修改表名?

时间:2020-09-23 14:20:08 作者:重庆seo小潘 来源:
本篇文章将和大家讲述如何快速修改mysql表名,有同样需要的朋友学习一下吧,希望你看后能有所帮助。 mysql修改表名的方法: 具体步骤:打开cmd-输入“mysql -u root -p”-输入密码,进入mysql-输入“alter table rename to/as new_tablename;” 下面的代码包

mysql怎么修改表名?

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

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怎么修改表名?的详细内容,更多请关注小潘博客其它相关文章!