mysql如何重命名数据表名? 如题!还有一个问题,就是怎么把同一数据库里的table1表的内容导入到table2中? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 RENAME TABLE tbl_name TO new_tbl_name [, tbl_name2 TO new_tbl_name2] ...This statement renames one or more tables. mysql> select version();+----------------------+| version() |+----------------------+| 5.1.33-community-log |+----------------------+1 row in set (0.06 sec)mysql> create table sunyiqiao719 (id int,f int);Query OK, 0 rows affected (0.14 sec)mysql> show tables like 'sunyiqiao%';+-----------------------------+| Tables_in_csdn (sunyiqiao%) |+-----------------------------+| sunyiqiao719 |+-----------------------------+1 row in set (0.00 sec)mysql>mysql> RENAME TABLE sunyiqiao719 TO sunyiqiao718;Query OK, 0 rows affected (0.08 sec)mysql> show tables like 'sunyiqiao%';+-----------------------------+| Tables_in_csdn (sunyiqiao%) |+-----------------------------+| sunyiqiao718 |+-----------------------------+1 row in set (0.00 sec)mysql> insert into table2 select * from table1; 求助!《数据库系统概论》上的一道习题,查询遇到难题了。 2003下LAMP错误! MySQL数据库运行状态数据的采集方法 mysql 批量插入问题 如何用sql语句查出最大值、最小值等 请教:取得表中上下两条数据的差值,有什么好办法吗?请赐教! 求救MySql显示转换的问题!急急 急,急,急,小弟的MYSQL的问题 mysqld等占用太多内存,怎么办? 求助SQL的问题 谢谢 CommonDBUtils操作mysql 关于mysql.sock的问题
[, tbl_name2 TO new_tbl_name2] ...This statement renames one or more tables. mysql> select version();
+----------------------+
| version() |
+----------------------+
| 5.1.33-community-log |
+----------------------+
1 row in set (0.06 sec)mysql> create table sunyiqiao719 (id int,f int);
Query OK, 0 rows affected (0.14 sec)mysql> show tables like 'sunyiqiao%';
+-----------------------------+
| Tables_in_csdn (sunyiqiao%) |
+-----------------------------+
| sunyiqiao719 |
+-----------------------------+
1 row in set (0.00 sec)mysql>
mysql> RENAME TABLE sunyiqiao719 TO sunyiqiao718;
Query OK, 0 rows affected (0.08 sec)mysql> show tables like 'sunyiqiao%';
+-----------------------------+
| Tables_in_csdn (sunyiqiao%) |
+-----------------------------+
| sunyiqiao718 |
+-----------------------------+
1 row in set (0.00 sec)mysql>
insert into table2 select * from table1;