1.复制表结构和字段但不复制主键和索引
mysql> create table aa select * from commodity;
2.复制结构和主键但不拷贝表的数据
create table commodity_new like commodity;
insert into commodity_bak select * from commodity;//完全拷贝
3.通过mysqldump
mysqldump wiki -h 192.168.1.200 -uroot -proot --add-drop-table | mysql wiki -u root -proot
阅读(837) | 评论(0) | 转发(0) |