MySQL同实例下复制表的2种方法

很简单的MySQL同实例下复制表的方法,可以略过。

需求:
在test库下创建表,要求导入hellodb.students的数据。

方法1:
use test;
create table t2 as select * from hellodb.students;

方法2:
use test;
create table t1 like hellodb.students;
insert into t1 select * from hellodb.students;

方法2的效果更好,具体可以看下图。

猜你喜欢

转载自www.linuxidc.com/Linux/2017-04/142837.htm