说明
1、将一个表的数据迁移到另一个表,或者将一部分指定的数据迁移到另一个表。
2、将一个表的大量数据复制到另一个表中。
3、将一个表的数据复制到自己的表中,以产生大量的数据。
实例
mysql> desc test; +-------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(20) | YES | | NULL | | | sex | varchar(1) | YES | | NULL | | | age | tinyint(3) unsigned | YES | | NULL | | +-------+---------------------+------+-----+---------+----------------+ mysql> desc user; +-------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(20) | YES | | NULL | | | age | tinyint(3) unsigned | YES | | NULL | | +-------+---------------------+------+-----+---------+----------------+ mysql> select * from test; +----+-------+------+------+ | id | name | sex | age | +----+-------+------+------+ | 1 | name1 | 男 | 5 | | 2 | name2 | 女 | 10 | | 3 | name3 | 男 | 15 | | 4 | name4 | 男 | 20 | +----+-------+------+------+ mysql> select * from user; Empty set (0.00 sec) mysql> insert into user (name, age) select name, age from test; Query OK, 4 rows affected (0.00 sec) mysql> select * from user; +----+-------+------+ | id | name | age | +----+-------+------+ | 1 | name1 | 5 | | 2 | name2 | 10 | | 3 | name3 | 15 | | 4 | name4 | 20 | +----+-------+------+
以上就是mysql蠕虫复制的使用场景,希望对大家有所帮助。更多mysql学习指路:MySQL
推荐操作系统:windows7系统、mysql5.8、DELL G3电脑